Probably most people don't look much at Tools > Process Browser. I never did until I doing the delay refactoring to keep track of when the timer event loop was running. I often find several of the following processes stuck on a semaphore... [ sem notNil ifTrue: [ sem wait. view ifNotNil: [ view stylerStyledInBackground: text ] ] ] forkAt: Processor activePriority. So I had a little dig. Now trying to fix this multithreaded code at this late stage has some risk of destabilising things, so I propose the following minimal effective change... [ sem notNil ifTrue: [ (sem waitTimeoutSeconds: 5) ifFalse: [ view ifNotNil: [ view stylerStyledInBackground: text ] ] ] ] forkAt: Processor activePriority. Can anyone more familiar with SHTextStyler than the half hour I've had comment if they foresee any problem with that? cheers -ben
Hi Ben, Ah, I absolutely hate those ugly guys, I often terminate them by hand, just to have a clean Process Browser listing ;-) I applied your patch to SHTextStyler>>#styleInBackgroundProcess: and will see what it gives in my current working image. I will report back. Sven
On 27 Mar 2015, at 16:04, Ben Coman <btc@openInWorld.com> wrote:
Probably most people don't look much at Tools > Process Browser. I never did until I doing the delay refactoring to keep track of when the timer event loop was running.
I often find several of the following processes stuck on a semaphore... [ sem notNil ifTrue: [ sem wait. view ifNotNil: [ view stylerStyledInBackground: text ] ] ] forkAt: Processor activePriority.
So I had a little dig. Now trying to fix this multithreaded code at this late stage has some risk of destabilising things, so I propose the following minimal effective change...
[ sem notNil ifTrue: [ (sem waitTimeoutSeconds: 5) ifFalse: [ view ifNotNil: [ view stylerStyledInBackground: text ] ] ] ] forkAt: Processor activePriority.
Can anyone more familiar with SHTextStyler than the half hour I've had comment if they foresee any problem with that?
cheers -ben
On Fri, Mar 27, 2015 at 11:10 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi Ben,
Ah, I absolutely hate those ugly guys, I often terminate them by hand, just to have a clean Process Browser listing ;-)
I applied your patch to SHTextStyler>>#styleInBackgroundProcess: and will see what it gives in my current working image. I will report back.
Thanks Sven. You pain prompted me to open an issue https://pharo.fogbugz.com/default.asp?15240 I think its low risk, so I'll be optimistic and submit a slice in case your experience is good. cheers -ben
participants (2)
-
Ben Coman -
Sven Van Caekenberghe