[omniORB] omnithread and thread cancellation

Duncan Grisby duncan@grisby.org
Thu, 02 May 2002 13:15:07 +0100


On Wednesday 1 May, ml wrote:

> has somebody ever introduced thread cancellation to
> omnithreads?  I know, that omnithread lacks support for
> thread cancellation for portability reasons, but we are in
> need of thread cancellation and all our platform do have it
> (Windows NT, Solaris, Linux).

Thread cancellation is almost always a bad idea, since you can never
be certain what state things have been left in. It is far safer to
implement it yourself with a flag that each thread checks
occasionally. If the flag tells a thread to die, it can clean up
safely.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --