> Phrased differently: do threads which exited,
> but who weren't joined use up any resources?

Yes (memory, but not cpu).

It sounds like you are creating one thread per request, and 
the threads now stay alive until the end of the program.

One solution is to have the threads exit (via the pthread_join
mechanism, of course) when they have finished the current
request.

Another (very common) solution is not to create one thread per request,
but instead have a small set of worker threads, each one to handle
many requests over the life of the program.  A "master" thread
accepts requests, and gives each one to one of the worker threads.
Only if there are no available worker threads does it create new
threads.

J

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to