bug-commoncpp
[Top][All Lists]
Advanced

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

Re: Bug in thread code


From: David Sugar
Subject: Re: Bug in thread code
Date: Thu, 2 Jan 2003 08:03:53 -0500
User-agent: KMail/1.4.3

A self deleting thread never uses join, and hence terminate is meaningless for 
this scenareo.  So long as the thread is started with detach() rather than 
with start(), it should execute in effect as a co-routine and clean itself 
when when it exits by deleting itself.

On Thursday 02 January 2003 06:39, Albert Strasheim wrote:
> Hello,
>
> On Thu, 02 Jan 2003, Marcel Stadtmann wrote:
> > Thanks for your help. But i think this is not the real problem.
> > Maybe my discribtion was not correct. On the sample, the thread will
> > start, do his job, and then terminate. For me means this, the resource of
> > this thread should be free after termination. Is this not correct ?? Are
> > there still resources allocated ??
>
> It seems as if final() in myTCPSession is being called, so the "delete
> this" probably happens. This starts destructing the thread object, which
> hopefully calls a terminate() somewhere down the line, which stops the
> thread and cleans up the other bits and pieces.
>
> The obvious scenario related to threads where you could possibly run
> out of resources is when you start a bunch of joinable threads, but
> never join on them again, meaning their resources stick around until the
> parent process terminates.
>
> I ran your test, and on my system (using commoncpp2 from CVS) I had
> completed about 20000 connections before tcpthread segfaulted.
>
> While you wait for someone with a proper clue (i.e. not me :-)) to help
> you, you might want to try commoncpp2 from CVS and see if your problems
> persist. You can find instructions for doing a checkout here:
>
> http://savannah.gnu.org/cvs/?group=commoncpp
>
> I'll poke around the threads code some more today. Good luck!
>
> Cheers,
>
> Albert
>
>
> _______________________________________________
> 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]