Version française
Home     About     Download     Resources     Contact us    
Browse thread
how to kill native code threads?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <mottl@m...>
Subject: how to kill native code threads?
Hello,

the documentation of the "Thread.kill" function says that it only works for
bytecode-level threads.

But how can I terminate native threads from outside? Say, for example, I
want to run some state space search on several processors and create native
threads that search a specific part of the search space.

In the moment one returns with the solution I don't want the others
continue running. One could stop them by sending them some kind of stop
event, but the threads would have to check for this event at regular times,
which is unelegant to program and costs time: if the thread checks too
often, it will lose performance on the search; if it does so too seldom, we
might have a considerable delay until it reacts to the termination event.

Is there another (safe) way to do it?

Best regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl