- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在运行 ARM 的嵌入式 Linux 下创建计时器时遇到了问题。我正在使用自制的 C++ 库来管理计时器。我没有自己编写代码,尽管我可以访问源代码,但我并不深入了解实现...它工作了一段时间,然后我收到错误“EAGAIN”。
使用 strace 我注意到当它不工作时定时器 ID 非常高!
timer_create(CLOCK_MONOTONIC, {0, SIGRT_3, SIGEV_SIGNAL, {...}}, 0xbed50af4) = -1 EAGAIN (Resource temporarily unavailable)
在工作时查看相当低的计时器 ID:
timer_create(CLOCK_MONOTONIC, {0x3, SIGRT_3, SIGEV_SIGNAL, {...}}, {0x3d}) = 0
我以为定时器的数量是无限的!其实并不是?我们应该在完成计时器后销毁它吗?我还使用了“timer_stats”内核实用程序,但这对我没有太大帮助......内核或任何其他工具中是否有其他用于定时器的调试实用程序?
感谢您的帮助!
最佳答案
您猜对了,您确实有最大数量的计时器:
The kernel preallocates a "queued real-time signal" for each
timer created using timer_create(). Consequently, the number
of timers is limited by the RLIMIT_SIGPENDING resource limit
(see setrlimit(2)).
timer_create(3posix)
联机帮助页对此更为直白:
The timer_create() function shall fail if:
EAGAIN The system lacks sufficient signal queuing resources
to honor the request.
EAGAIN The calling process has already created all of the
timers it is allowed by this implementation.
虽然您可以提高挂起信号的 setrlimit(2)
限制(bash(1)
中的 ulimit -i
),但请注意这会分配真正的内核内存——这是一种极其有限的资源。
我建议修改您的应用程序以删除或重新使用旧计时器。
关于c++ - timer_create() : -1 EAGAIN (Resource temporarily unavailable),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8179427/
我有一个使用 ARM 模板创建的 python 函数应用程序。当我尝试使用 azure Devops 管道部署函数时,我遇到以下错误, “无法将Web包部署到应用服务。服务暂时不可用代码503” 最佳
如果我在 Python 解释器中创建了一个包含大量进程的池,它显然会出错,但是在这样做之前似乎并没有清理 fork 进程,因此留下了环境脏,系统的其余部分无法 fork 进程。 >>> from mu
我正在构建一个包含 DT 的 UI表格和 slider (均作为输入),以及绘图输出。这些表格用于从多个表格中进行选择。用户只能选择一个单元格进行选择。 我希望用户能够存储表格和 slider 的设置
有没有办法暂时将拆分 Pane 扩展为完整选项卡并在完成后再次返回?我正在寻找一个键盘快捷键来执行此操作。用例是能够根据需要临时切换到全屏。 最佳答案 要最大化事件面板,只需在要扩展的屏幕上 Cmd
我正在开发一个用 PHP 和 Mysqli 编写的复杂数据库应用程序。对于大型数据库操作,我使用后台运行的守护进程(也是 PHP)。在这些可能需要几分钟的操作期间,我想阻止用户访问受影响的数据并向他们
就在几天前,我能够访问我的谷歌电子表格来自一个应用程序(在应用程序引擎中),但今天它坏了。 也就是说,我可以 name= "name of my spreadsheet" self.client =
我开发和维护用 JSP 和 Java 编写的小型内联网 Web 应用程序。它们在 Resin 网络服务器上运行,没有像 Apache 那样的专用 httpd。 在执行维护之前,我激活了一个非常简单的
这是一段代码: public function uploadPhoto(){ $filename = '../storage/temp/image.jpg'; file_put_co
为什么以下代码会在 80% 的时间内打印“read(): Resource temporary unavailable”?那就是EAGAIN代码,和WOULD BLOCK一样,表示没有数据等待读取,但
我正在尝试在 C 的 linux (red-hut) 中创建单线程服务器,它将监听多个套接字。 当我像这样将标志设置为非阻塞时,我需要使用非阻塞套接字: int flagss = fcntl(sock
在网页时出现503 service temporarily unavailable是什么意思?这让很多网友在访问某个网站时摸不着头脑,想看的网页打不开,只能灰溜溜地关闭。而这也对很
最近网站刷新后经常出现503 Service Temporarily Unavailable错误,有时有可以,联想到最近在nginx.conf里做了单ip访问次数限制,(limit_req_zone
我在一个启用了 envers 的项目中创建了一个实体复制器,但是对于这个复制器我不需要审计:有没有办法暂时禁用 envers 审计? 我知道有一些监听器作为拦截器(在审计触发器之前),但我还需要知道审
我有 apache 坐在我的节点服务器前面。节点在某个端口上运行,我使用 apache 代理到该端口,并且还为 https 配置了 apache。 当我启动 apache 然后启动我的节点服务器时,一
Sequelize.js 有没有办法暂时禁用时间戳,最好是单个查询? 特别是,我正在运行一个查询 MyModel.update({ UserId: 1 }, { where: {
我尝试在本地开发系统上设置 Varnish ,但它在启动后几秒钟终止,并显示以下消息: varnishd -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:81 -F
(在 Azure 门户中报告支持问题时,似乎没有选择 Application Insights 的选项,因此发布了这篇文章) 在大约 12 小时内,当我尝试查看特定应用服务的 Application
供引用: 我在 docker desktop for mac 上运行 Kubernetes 基于Nginx镜像的网站 我在 Kubetesetes 上运行 2 个简单的网站部署并使用 NodePort
(在 Azure 门户中报告支持问题时,似乎没有选择 Application Insights 的选项,因此发布了这篇文章) 在大约 12 小时内,当我尝试查看特定应用服务的 Application
编辑: 我正在以矩阵乘法为例学习多线程,我创建了这个程序: #include #include #include #include using namespace std; int N = 5
我是一名优秀的程序员,十分优秀!