Process status

Alexander Lazarevic lazarevi at prinz-atm.cs.Uni-Magdeburg.DE
Sun Jul 12 08:38:07 UTC 1998


 > If the shepard process get's terminated without running to completion,
 > the semaphore will never get signaled, though.

I changed the way the processes get their data. So I don't have to
check when they have finished. My attempt looks something like
this

| sq |
sq := SharedQueue new.
sq nextPut: 'Nasi'; nextPut: 'Goreng'; nextPut: 'Chop'; nextPut: 'Suey'.
1 to: 2 do: [:pid|
   [[sq isEmpty] whileFalse: [Transcript show: sq next; cr. Processor yield]] fork].

Now I want to see, which process outputs the data. So my first try
was:

Transcript show: pid printString, ' ', sq next

That won't work, because after the loop pid is 3 and all processes
return that value. So how do I create a variable, that is local to a
block? Something like [:pid| blockTemp | blockTemp := pid ] won't work
either.

-- 
------  Alexander  Lazarevic  ------------------------------------------------
-- Otto-von-Guericke-Universitaet      mailto: lazarevi at cs.uni-magdeburg.de --
--   Computational Visualistics    http://www.cs.uni-magdeburg.de/~lazarevi --





More information about the Squeak-dev mailing list