[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exception systems



|   Date: Thu, 18 Apr 1996 19:37:50 -0400
|   From: Olin Shivers <shivers@lambda.ai.mit.edu>
|   Cc: blume@cs.Princeton.EDU, will@ccs.neu.edu, rrrs-authors@mc.lcs.mit.edu
|   Reply-To: shivers@ai.mit.edu
|
|      One last thing.  Even in a fully threaded model, you still need the
|      ability to inject code into another thread.  
|
|   Why?

Because otherwise you need to have a zillion little functions of the
following flavor

(kill-thread <thread>)
(raise-in-thread <condition> <thread>)
(block-thread <mutex> <thread>)

etc., and no matter how many you have, ultimately you will find some
case that you haven't thought of before and lose.


It is much more powerful (and obviously sufficient) to have

(run-in-thread <thread> <thunk>)

where <thunk> is made to run within the thread.