Re: [Pharo-users] Semaphore wait and signal

2016-05-12 Thread stepharo
Superb email ben We should really push a little tutorial on concurrent programming with Pharo :) Stef Le 11/5/16 à 15:08, Ben Coman a écrit : On Tue, May 10, 2016 at 6:31 PM, Vince Refiti wrote: Hello I am playing around with Semaphore, and wrote the following: [snip] Can someone plea

Re: [Pharo-users] Semaphore wait and signal

2016-05-11 Thread Ben Coman
On Tue, May 10, 2016 at 6:31 PM, Vince Refiti wrote: > Hello > > I am playing around with Semaphore, and wrote the following: [snip] > Can someone please explain this pattern? I rearranged again to make the output self explanatory... | coll count sem | Transcript clear; show: 'count' ; tab

Re: [Pharo-users] Semaphore wait and signal

2016-05-10 Thread Ben Coman
On Tue, May 10, 2016 at 6:31 PM, Vince Refiti wrote: > Hello > > I am playing around with Semaphore, and wrote the following: > > | coll count sem | > coll := Array withAll: (1 to: 100). > count := 0. > sem := Semaphore new. > coll do: [ :each | > count := count + 1. > (count >= 5) >

Re: [Pharo-users] Semaphore wait and signal

2016-05-10 Thread p...@highoctane.be
Transcript output logic is wicked, flush or not. Especially if you Halt now. Check for stepGlobal senders and implmenters and see it in all its glory with flags and all. You can then understand why things are weird. Some World doOneCycle peppered around may confuse things a bit more. Use a log

Re: [Pharo-users] Semaphore wait and signal

2016-05-10 Thread Johan Fabry
Hi Vince, some of your problem may be in the Transcript buffering some of its output. It is best to add a ; flush to the end of all your printing, e.g. Transcript show: 'waiting...'; cr ; flush. HTH > On May 10, 2016, at 07:31, Vince Refiti wrote: > > Hello > > I am playing around with Sema

[Pharo-users] Semaphore wait and signal

2016-05-10 Thread Vince Refiti
Hello I am playing around with Semaphore, and wrote the following: | coll count sem | coll := Array withAll: (1 to: 100). count := 0. sem := Semaphore new. coll do: [ :each | count := count + 1. (count >= 5) ifTrue: [ Transcript show: 'waiting...'; cr. sem