This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: pthread_create() returning EINTR? (glibc-2.1.3, Linux x86 kernel 2.2.15, gcc-2.95.2)
Ulrich Drepper wrote:
>
> "George T. Talbot" <george@moberg.com> writes:
>
> > I don't doubt this is probably a bug in my program...I'm still working
> > on a test case. What I would appreciate, though, is that if
> > pthread_create() fails, that it should signal _why_ it fails via errno
> > or some other mechanism.
>
> ERRORS
> The pthread_create( ) function shall 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
OK...went through and checked some more. I get EAGAIN returned from
pthread_create(). If I zero errno, it stays zero. If I do a "ps" I see
160 processes, which means 159 threads, when it stops working. The
specific problem I have with EAGAIN is that I would like to know _which_
limit my program is hitting.
Most likely, I forgot a pthread_join() or pthread_detach() somewhere, or
maybe I'm running out of VM for the thread stacks, or maybe something
else is happening.
I know POSIX says return EAGAIN, but...
--
George T. Talbot
<george at moberg dot com>