Menu

How asynchronous is Thread::terminate() ?

Help
2002-07-25
2002-09-02
  • Norbert Koch

    Norbert Koch - 2002-07-25

    Hello,

    I am running a kind of watchdog thread to
    terminate other runaway threads.
    Although calling setCancel (cancelImmediate)
    I only see the thread cancelling at a
    cancellation point (like e.g. sleep()).

    Is this correct Posix behaviour
    or a platform specifiy PThread-bug
    (I am trying this under FreeBSD 4.6.)
    CommonC++ itself obviously seems to
    do nothing wrong, as far as I understand.

    Currently I get around this by sending a SIGABRT
    to the runaway thread, doing a longjmp() from
    onException() into initial() and calling testCancel()
    in initial(). It works but looks pretty complicated for me.

    Thanks in advance,

    Norbert Koch

     
    • David Sugar

      David Sugar - 2002-09-02

      I have noticed a few other abberations in thread behavior under FreeBSD specifically, and I suspect they only support soft cancellation points currently.  Have you tried the port of LinuxThreads under FreeBSD?  There is now an option to Build Common C++ for this...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.