Skip to content
Tcl Source Code View Ticket
Login

View Ticket

thread::release treats hanging processes wrongly

Closed / Wont Fix1578877fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 19 years ago
Descriptionplain2006-10-17 11:43:20
If you run a process in a thread and try to kill it 
with thread::release, then the thread ID will be 
removed from the list even though it remains running, 
e.g. if it is stuck in an infinite loop.
vasiljevicplain2006-10-17 19:28:55
Logged In: YES 
user_id=95086

What do you mean by "if you run a process in a thread" ?
Can you give me a small example in Tcl to illustrate the
problem? 
What platform are you using?
vasiljevicplain2007-06-30 21:41:14
Logged In: YES 
user_id=95086
Originator: NO

You do not "kill" a thread with thread::release.
You merely flip a bit that controls what the 
thread will do when it re-enters its event loop 
again. If the thread never visits the event loop
because it is stuck in executing some external
process, the outcome is undefined. 

Please note that threads are not of an preemptive,
rather cooperative "multitasking". You cannot 
execute the same level of control (i.e. kill) on 
threads like you can do on processes as this 
will create whole lotta havoc on shared resources 
(including deadlocks of various kinds).

I will close this ticket now.
Log in (anonymous is fine) to add a comment.