Multiple processes using #nextPutAll:

Bert Freudenberg bert at freudenbergs.de
Sat May 26 14:22:30 UTC 2007


On Sat, 26 May 2007 14:12:59 +0200, Damien Cassou wrote:
> Thank you for this comments. That was what I was afraid of. Is it
> possible to have test that will show #nextPutAll: is not protected?

I'm not convinced #nextPutAll: should be atomic. It would mean a  
consumer cannot start processing queued items before all elements are  
written. Right now, #nextPutAll: uses #nextPut: which is "protected".  
Nothing to fix IMHO.

The test to find out whether #nextPutAll: is atomic or not would be  
to have a higher-priority reader process that reads one element and  
peeks for the next. If that succeeds, the lower-priority writer  
process managed to put in more than one element, meaning #nextPutAll:  
is not atomic. With the current behavior, however, the reader process  
would be activated as soon as the first element was written and the  
peek would fail (I mean, answer nil).

- Bert -





More information about the Squeak-dev mailing list