AIX pthread_create 失败并出现 EAGAIN。 WLM 对线程的类限制?

发布于 2024-09-11 15:03:08 字数 1000 浏览 13 评论 0原文

pthread_create 的 AIX 手册页记录了 EAGAIN pthread_create 失败的以下原因:

       EAGAIN
            If WLM is running, the limit on the number of threads in the class is reached.
       EAGAIN
            The limit on the number of threads per process has been reached.

我在启动 300 个线程的测试代码中看到了这一点。奇怪的是,我可以创建一个最多包含 2400 个线程的测试程序(尽管我必须减小默认堆栈大小以避免 ENOMEM),并且我似乎没有达到每个进程的任何类型的线程限制,也没有达到 WLM 限制。

由于我遇到的似乎不是每个进程的 AIX 线程限制,因此我想知道 EAGAIN 的其他 AIX 源,或者如何为特定进程配置 WLM。我们的产品确实支持 WLM,我想知道此测试代码是否意外地将自身配置为 WLM 类的一部分,以及执行此操作的机制是什么?

更新:

看来我得到的 EAGAIN 是一些未记录的 pthread_create 错误条件,而不是 WLM,因为我看到:

# wlmcntrl -q
1495-054 WLM is stopped

我还发现 ps 命令可用于查询与进程关联的 WLM 类,再次

# ps -m -o THREAD,class -p 1040410
    USER     PID    PPID       TID ST  CP PRI SC    WCHAN        F     TT BND COMMAND         CLASS
 peeterj 1040410 2318428         - A    1  60  3 f1000602d5c19bb0   200801 pts/19   - /vbs/engn/sqo/t Unclassified
...

如下排除 WLM 作为 EAGAIN 的来源。

The AIX man page for pthread_create documents the following reasons for an EAGAIN pthread_create failure:

       EAGAIN
            If WLM is running, the limit on the number of threads in the class is reached.
       EAGAIN
            The limit on the number of threads per process has been reached.

I'm seeing this in test code that starts 300 threads. The curious thing is that I can create a test program with up to 2400 threads (although I have to reduce the default stack size to avoid ENOMEM) and I don't appear to hit any sort of threads per process limit, nor a WLM limit.

Since it doesn't appear to be the AIX threads per process limit that I am hitting, I'm wondering about other AIX sources of EAGAIN, or how WLM is configured for a specific process. Our product does have WLM support, and I'm wondering if this test code accidentally configures itself as part of a WLM class, and what the mechanism to do this is?

Update:

It appears that the EAGAIN that I am getting is some undocumented pthread_create error condition and not WLM, since I see:

# wlmcntrl -q
1495-054 WLM is stopped

I also found that the ps command can be used to query what WLM class a process is associated with, as in

# ps -m -o THREAD,class -p 1040410
    USER     PID    PPID       TID ST  CP PRI SC    WCHAN        F     TT BND COMMAND         CLASS
 peeterj 1040410 2318428         - A    1  60  3 f1000602d5c19bb0   200801 pts/19   - /vbs/engn/sqo/t Unclassified
...

which again rules out WLM as a source of the EAGAIN.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文