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
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
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)
>
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
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
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