Hi Eric,

On 1/25/07, Eric Sokolowsky <[EMAIL PROTECTED]> wrote:
I was having many problems with crash-on-exit problems when I was using the
OpenThreads::Cancel facility. I found it a lot more stable to just set a
global variable and check that periodically within each thread and just
exit when it was set. Since I'm on Linux OpenThreads uses pthreads underneath,
and I never got a satisfactory explanation on why pthread_cancel would
behave that way.

The problems I found were generally down to pthread_cancel only
cancelling when the thread gets to a pthread cancellation point, if
the code doesn't go through any of these then pthread_cancel will be
ignored.  If other code then assume that the cancel has succeeded and
deletes associated objects the threads can end up reference deleted
memory.

The are several different types of pthread_cancel you can use.  I
can't recall all the details off the top of my head, running through
man pthreads or online docs will help.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to