[ENH] inter-process signaling

ned at bike-nomad.com ned at bike-nomad.com
Sun Sep 21 18:29:14 UTC 2003


from preamble:

"Change Set:		InterProcessSignaling-svp
Date:			21 September 2003
Author:			Stephen Pair

[re-posted by Ned Konz as an attached changeset]

The attached file-out is an improved inter-process signaling mechanism. 

It adds a method #signal: to Process that accepts an exception as its 
argument.  It will signal the exception in the context of the receiver. 

If the receiver is currently suspended (i.e. not on a list), the 
exception will not get signaled until the process is resumed.  If the 
receiver is currently blocking on a Semaphore, this method will return 
the receiver to a non-blocked state and the process will resume with the

exception being signaled.  If that exception is handled and resumed, the

process will return to a blocked state if the semaphore does not have 
any excess signals.

So, as Ned pointed out, you could use this to timeout a process that is 
waiting on a Semaphore with an exception.  It might look something like 
this.

  | sem proc |
  sem := Semaphore new.
  proc := [sem wait] newProcess.
  proc resume.
  (Delay forSeconds: 5) wait.
  proc signal: (Error new messageText: 'hey wake up!!'; yourself).

I think this has the potential for a multitude of uses.  I can imagine 
extending the process browser such that you can right click and send a 
variety of common signals to a process.

- Stephen
"!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InterProcessSignaling-svp.cs.gz
Type: application/octet-stream
Size: 1578 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030921/b096cb0e/InterProcessSignaling-svp.cs.obj


More information about the Squeak-dev mailing list