tags:

views:

39

answers:

0

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.