Re: pthread_create returns error code 11

Discussion in 'C Programming' started by Drew Lawson, May 27, 2009.

  1. Drew Lawson

    Drew Lawson Guest

    [First, I agree with asking the next question in the threading group.]
    That would depend on what error 11 is. On my system, errno.h says:
    #define EDEADLK 11 /* Resource deadlock avoided */
    /* 11 was EAGAIN */

    So, 11 once was EAGAIN, which is a known return for pthread_create().
    It may still be on your implementation. My system's man page says:
    The pthread_create() function will fail if:

    [EAGAIN] The system lacked the necessary resources to create
    another thread, or the system-imposed limit on the
    total number of threads in a process
    [PTHREAD_THREADS_MAX] would be exceeded.

    My next guess is that your system won't allow a user process to run
    24 (additional) threads. But most of what I can say about pthreads
    is guesses. The experts in comp.programming.threads know this stuff
    inside and out.
    Drew Lawson, May 27, 2009
    1. Advertisements

  2. It seems likely that it is, given the code that produced it.

    Of course, he can find out for sure by passing the return value from
    pthread_create() to strerror().
    Antoninus Twink, May 28, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.