[vwnc] [vw7.6] SuspendedDelays

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] [vw7.6] SuspendedDelays

Holger Kleinsorgen-4
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
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [vw7.6] SuspendedDelays

Andres Valloud-6
AR 54729, thank you!

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] 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
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc