🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.mach
Article #1289

cthread termination (was: notification of thread death)

#1289
From: Eric Hammond
Date: Fri, 16 Feb 1990 17:23
31 lines
1769 bytes
In article <8ZqaNoK00hYPEpsEdz@cs.cmu.edu>
Richard.Draves@CS.CMU.EDU writes:
> In any case, I don't think it is a good idea to kill a thread that the
> cthreads library thinks it is using.
>
> Perhaps you could just have your cthread send its own notification
> messages before it exits?

At the moment I am doing the equivalent of sending notification of
cthread termination just before each cthread exits.  So far this is
working fine; however, I have a couple more questions:

1) Is there any way for a cthread to terminate unexpectedly (i.e.,
   without doing an explicit cthread_exit() or returning from the
   cthread's top level function)?  Tasks may be terminated by memory
   exceptions, signals, etc.; is there anything like this that will
   terminate a single cthread?  (I don't want any cthreads in this task
   to die without the main cthread of the task knowing it.)

2) I understand the problem with thread_terminate()ing a thread out
   from under the cthread library implementation.  Is there any way
   to do a cthread_terminate()?  How can one cthread terminate
   the execution of another cthread in a task?  Is it necessary to
   set up a "please kill yourself" message or to use similar
   inter-cthread cooperation?

Thanks also to Bill Bolosky for responding to the original question.

-- 
Eric Hammond
erich@kgw2.bwi.wec.com
Technical Details
Message-ID: <374@kgw2.bwi.WEC.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!uccba!spca6!kgw2!erich

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!uccba!spca6!kgw2!erich
From: erich@kgw2.bwi.WEC.COM (Eric Hammond)
Newsgroups: comp.os.mach
Subject: cthread termination (was: notification of thread death)
Message-ID: <374@kgw2.bwi.WEC.COM>
Date: 16 Feb 90 17:23:52 GMT
Distribution: usa
Organization: Xetron Corp, Cincinnati Ohio
Lines: 31