[bug] Intermittent DNU using Delay

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

[bug] Intermittent DNU using Delay

Tony Garnock-Jones-4
Issue status update for
http://smalltalk.gnu.org/node/153
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/153

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  tonyg
 Updated by:   tonyg
 Status:       active

The following test program will, in roughly 50% of its runs on my
machine, generate the following backtrace immediately after the first
"Global garbage collection... done" message. In the other runs, the
global collection message prints and the program continues running
without the backtrace. I'm not sure if the backtrace has caused any of
the three Processes to exit.


Backtrace:



~$ gst threading-preemption.st
"Global garbage collection... done"
Object: nil error: did not understand #goodness:
MessageNotUnderstood(Exception)>>signal
UndefinedObject(Object)>>doesNotUnderstand: #goodness:
optimized [] in BlockClosure class>>exceptionHandlerSearchBlock
[] in Kernel.CoreException>>instantiateNextHandler:
MethodContext(ContextPart)>>scanBacktraceForAttribute:do:
Kernel.CoreException>>instantiateNextHandler:
MessageNotUnderstood(Exception)>>signal
UndefinedObject(Object)>>doesNotUnderstand: #key
Delay class>>unscheduleDelay:
Delay class>>handleDelayEvent
optimized [] in Delay class>>runDelayProcess
[] in BlockClosure>>ifCurtailed:
BlockClosure>>ensure:
BlockClosure>>ifCurtailed:
Delay class>>runDelayProcess
optimized [] in Delay class>>startDelayLoop
[] in Process>>onBlock:at:suspend:
BlockClosure>>on:do:
[] in Process>>onBlock:at:suspend:
BlockClosure>>ensure:
[] in Process>>onBlock:at:suspend:
[] in BlockClosure>>asContext:
BlockContext class>>fromClosure:parent:

Code:



"Attempt to use a high-priority process to preempt lower-priority
processes. Doesn't work."

[
  | d |
  d := Delay forMilliseconds: 10.
  [
    d wait.
  ] repeat.
] forkAt: Processor highestPriority.

[
  [
    Transcript show: 'one'.
    (Delay forMilliseconds: 10) wait.
  ] repeat.
] fork.

[
  [
    Transcript show: 'two'.
    (Delay forMilliseconds: 10) wait.
  ] repeat.
] value.



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] Intermittent DNU using Delay

Paolo Bonzini
Issue status update for
http://smalltalk.gnu.org/project/issue/153
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/153

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  tonyg
 Updated by:   bonzinip
-Status:       active
+Status:       invalid

It is not a good idea to use Delay in processes running at
timingPriority or higher.  There may be races between the process and
Delay's coordinating process (which runs at timingPriority) in
accessing Delay's data structures.  Use highIOPriority instead.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk