[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnustep-base thread creation bug.

From: Richard Frith-Macdonald
Subject: Re: Gnustep-base thread creation bug.
Date: Mon, 30 Apr 2007 06:16:00 +0100

On 27 Apr 2007, at 22:56, Chris Ball wrote:

Right now there appears to be a slightly subtle bug in thr-pthread.m.
Specifically the threads created here are created as joinable threads, this is
bad because joinable threads have to be joined before their memory is
released. What we really want here are detached threads that just go away when
they are done executing.

This is trivial to test, create a program that spawns threads that do nothing but exit and watch as the memory usage explodes as the thread count grows (I manage around 300 threads before a cryptic message that actually means ENOMEM
turns up).

I think thr-pthread.m is used only on OpenBSD systems, and I don't have one to test on.

I've changed the code to use _objc_thread_attribs to set the thread as not joinable in subversion trunk, and I would be grateful if you could test this and let me know if it's ok (if it is, I'll backport it to the stable branch).

Looking at the code in the objc runtime library, it seems like that would heave exactly the same problem with libpthread and thr-pthread.c Do you know if that's the case? If so, do you know if it has been reported to the gcc maintainters?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]