Hi Jaromir,

please take a look at Collections-mt.923 (inbox). Maybe those changes would satisfy all your current needs in this regard. :-)

@all: Would Transcript now be thread-safe? Did I miss something?

Best,
Marcel

Am 25.01.2021 21:38:36 schrieb jaromir <m@jaromir.net>:

Well, I tried deferring the whole Transcript endEntry machinery to the UI
doOneCycle (bypassing the changed: #appendEntryLater mechanism) for
#forceUpdate = false only ... and it seems to avoid the problem!

TranscriptStream >> endEntry

deferredEntry ifNil: [ false ]. "this is a new instance variable"
self semaphore critical:[
self class forceUpdate
ifTrue: [self changed: #appendEntry; reset]
ifFalse: [deferredEntry := true].


TranscriptStream >> flushDeferredEntry
"This is run every UI cycle in doOneCycleNowFor:"

deferredEntry ifTrue: [
self class forceUpdate: true.
self endEntry.
deferredEntry := false.
self class forceUpdate: false.
]

doOneCycleNowFor: aWorld

"... the whole body remains unchanged except:"

capturingGesture ifFalse:
[aWorld runStepMethods.
Transcript flushDeferredEntry. "this is printing for #forceUpdate =
false"
self displayWorldSafely: aWorld].


For #forceUpdate = true the endEntry mechanism remains unchanged and failing
as before...



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html