This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: pthread detach problem with glibc 2.2 on SMP
- To: Andreas Jaeger <aj at suse dot de>
- Subject: Re: pthread detach problem with glibc 2.2 on SMP
- From: Ulrich Drepper <drepper at redhat dot com>
- Date: 06 Dec 2000 00:24:52 -0800
- Cc: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>, Ruediger Oertel <ro at suse dot de>
- References: <hozoiaq8qi.fsf@gee.suse.de>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
Andreas Jaeger <aj@suse.de> writes:
> The following program compiled with:
> gcc -o pthread-test -g -O2 pthread-test.c -lpthread -Wall
>
> gives sometimes (try it at least 20 times) on an SMP system as result:
> abc: Interrupted system call
> def: Invalid argument
The behavior is correct. pthread_detach() returns ESRCH if the thread
ID is not valid. This can happen if the newly created thread gets
scheduled before the creating thread. It's a simple race condition.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------