Igor I m not surprised of the order. I know that transcript is totally unsafe :) Now this is probably the unclosure stuff that bites me... :) ...stef jumping to pharo and trying ... stef back | tt | Smalltalk at: #STranscript ifAbsent: [self installThreadSafeAsSTranscript]. tt := (Smalltalk at: #STranscript). tt open. [1 to: 10 do: [:x | tt nextPutAll: x printString; nextPutAll: '*'. Processor yield ] fixTemps. tt flush ] fork. [100 to: 110 do: [:i | tt nextPutAll: i printString; nextPutAll: '-'. Processor yield ] fixTemps. tt flush ] fork. 1*100-2*101-3*102-4*103-5*104-6*105-7*106-8*107-9*108-10*109-110- So I want closure..... definitively. Stef On Mar 29, 2009, at 4:54 PM, Igor Stasenko wrote:
2009/3/29 Igor Stasenko <siguctua@gmail.com>:
2009/3/29 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Hi all
I'm working on a threadSafeTranscript and I could not understand why the following code does not print something else than
1*100-102-103-104-105-106-107-108-109-110-
|tt| tt := Transcript. [1 to: 10 do: [:i | tt show: i printString; show: '*'. Processor yield ]. tt flush ] fork. [100 to: 110 do: [:i | tt show: i printString; show: '-'. Processor yield ]. tt flush ] fork.
What you expecting from it? If you imagine that Processes running in parallel, then numbers can be in any order , as well as * and - characters. Or you mean, that it eating 2-10 numbers which should be printed? In this case, the source of inconsistency could be the #flush method. But its hard to say, without looking at source code.
oh, and if you running it in image, without Eliot's closures, i'd recommend to use separate iterator for cycles, because it might be the case that parser using the same temp slot for 'i' temp in both blocks.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project