bug-commoncpp
[Top][All Lists]
Advanced

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

Re: Thread::detach bug


From: David Sugar
Subject: Re: Thread::detach bug
Date: Thu, 9 Jan 2003 08:02:45 -0500
User-agent: KMail/1.4.3

Since we now have a seperate "detach()" to kick off detached threads, yes, it 
would be very easy to have it set the priv->attr for detach before the 
pthread_create rather than doing so after the thread is created.  This would 
eliminate the race.

On Thursday 09 January 2003 07:34, Federico Montesino Pouzols wrote:
> Yes, I think this code could be more robust if instead of
> calling pthread_create and then pthread_detach, it set the detach
> attribute of the thread before pthread_create.
>
> On Wed, Jan 08, 2003 at 02:02:22PM +0200, Ittay Freiman wrote:
> > if i call Thread::detach, the thread is created in joinable mode, and a
> > line after pthread_detach is called. however, if the threads are short
> > lived, or the system is loaded, this line may execute after the thread
> > has finished its run, destroyed itself (in final(), as recommended in
> > the documentation) and therefore its resources are lost.
> >
> > --
> > Ittay Freiman <address@hidden>
> > Qlusters Inc.
> >
> >
> >
> > _______________________________________________
> > Bug-commoncpp mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/bug-commoncpp
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp





reply via email to

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