[osg-users] [patch] PThread.c++ creation error, lower stack size limit
cedric.pinson at plopbyte.net
Sun Nov 29 07:21:14 PST 2009
I had a weird issue, i think it's related to thread but dont know if
it's because of the submission. I use a lot of threads not at the same
time but on a long period. It seams the thread i create are not remove
from memory, so at the end of day i have 3Gb of virtual memory used.
Doing a memory map i can see a lot of memory entry with 8MB and at a
given time my program stop to create thread (from a limit i guess).
I did not dig enough yet to tell more, but if some of you have an idea
or suggestion i will take them.
+33 659 598 614 Cedric Pinson mailto:cedric.pinson at plopbyte.net
On Fri, 2009-10-16 at 08:31 -0500, David Fries wrote:
> This was against 2.8.1, but I see the trunk is identical.
> Any issues with using PTHREAD_STACK_MIN?
> I was trying to create a lot of threads under 32 bit Linux, but could
> only create 376, then the program would hang.
> 376 * 8MB stack per thread = 3008 MB
> The stack size allocated per thread blew the process address stack.
> To get more threads you have to specify a smaller per thread stack,
> but while the Thread::start says it will limit the stack size to the
> smallest allowable stack size, it won't let it be smaller than the
> default. I included the limits.h header to use PTHREAD_STACK_MIN as
> the minimum stack size.
> As for the deadlock, if the pthread_create failed, the new thread
> doesn't exist and doesn't call threadStartedBlock.release(), so the
> existing thread deadlocks on threadStartedBlock.block(). Only block
> if the thread was started.
> osg-users mailing list
> osg-users at lists.openscenegraph.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the osg-users