This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: question re: questions
Hello,
> Linuxthreads is pretty much broken when you call pthread_create after
> pthread_join and stack memory is reused for whatever reason.
You're right, I had forgotten about this. Note that this is _not a
bug_. The POSIX threads standard does _not_ guarantee that a thread
has "terminated" sufficiently after pthread_join() has returned so
that stack memory could be reused, see
http://groups.google.com/groups?selm=3A797AB3.A57D43E9%40compaq.com
This is another very strong argument against user-defined stacks BTW.
> The
> problem is the corrupted doubly linked list of active threads. The
> linked list is maitained by pthread_handle_create and pthread_exited.
> However, memset in pthread_allocate_stack can trash the doubly linked
> list before the dead threads are removed from the active thread list.
> I don't know what is the best fix. It can be very tricky.
Indeed, I have decided then that it is not worth while to bother with
this because even if you got it working, the feature couldn't be used
portably.
Regards,
Wolfram.