[vwnc] [vw7.6] SuspendedDelays

View: New views
2 Messages — Rating Filter:   Alert me  

[vwnc] [vw7.6] SuspendedDelays

by Holger Kleinsorgen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello,

my quite fresh vw 7.6 image contained about 56000 instances of Delay,
which made me investigate the issue. The origin of this accumulation was
the following pattern:

- fork a process
- within the the process, wait on a Delay
- terminate the process from outside before the Delay wakes up.

an example is the newly introduced BlockClosure>>valueWithinSeconds:orDo:

Terminating the process doesn't disable the Delay, so SuspendedDelays
still contains the Delay until it wakes up. Not a big problem, if the
Delays are short, but when using longer delays, SuspendedDelays can grow
beyond sane limits. One such candidate is Inspector>>text, which waits
for 5000 seconds (dunno why, I never wait 83 minutes ;).

My suggestion would be to manually disable the Delay in the ensure block:

valueWithinSeconds: aNumber orDo: alternateBlock
   | timedProcess delay |
   timedProcess := Processor activeProcess.
   delay := Delay forSeconds: aNumber.
   [  delay wait.
       timedProcess interruptWith: [ TimeoutExceeded raise ]
     ] forkAt: Processor timingPriority.
   ^ [
     [ self value ] ensure: [ delay disable ]
   ] on: TimeoutExceeded do: [: ex | alternateBlock value ]


_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Re: [vwnc] [vw7.6] SuspendedDelays

by Valloud, Andres :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

AR 54729, thank you!

-----Original Message-----
From: vwnc-bounces@... [mailto:vwnc-bounces@...] On
Behalf Of Holger Kleinsorgen
Sent: Tuesday, July 01, 2008 10:00 AM
To: VW NC
Subject: [vwnc] [vw7.6] SuspendedDelays

hello,

my quite fresh vw 7.6 image contained about 56000 instances of Delay,
which made me investigate the issue. The origin of this accumulation was
the following pattern:

- fork a process
- within the the process, wait on a Delay
- terminate the process from outside before the Delay wakes up.

an example is the newly introduced
BlockClosure>>valueWithinSeconds:orDo:

Terminating the process doesn't disable the Delay, so SuspendedDelays
still contains the Delay until it wakes up. Not a big problem, if the
Delays are short, but when using longer delays, SuspendedDelays can grow
beyond sane limits. One such candidate is Inspector>>text, which waits
for 5000 seconds (dunno why, I never wait 83 minutes ;).

My suggestion would be to manually disable the Delay in the ensure
block:

valueWithinSeconds: aNumber orDo: alternateBlock
   | timedProcess delay |
   timedProcess := Processor activeProcess.
   delay := Delay forSeconds: aNumber.
   [  delay wait.
       timedProcess interruptWith: [ TimeoutExceeded raise ]
     ] forkAt: Processor timingPriority.
   ^ [
     [ self value ] ensure: [ delay disable ]
   ] on: TimeoutExceeded do: [: ex | alternateBlock value ]


_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
LightInTheBox - Buy quality products at wholesale price!