bug-commoncpp
[Top][All Lists]
Advanced

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

Re: Bug in thread code


From: Albert Strasheim
Subject: Re: Bug in thread code
Date: Thu, 2 Jan 2003 13:39:17 +0200
User-agent: Mutt/1.4i

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



reply via email to

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