[feature] ObjectMemory quit waits for ever

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

[feature] ObjectMemory quit waits for ever

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

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  tonyg
 Updated by:   tonyg
 Status:       active

In cases where an anonymous background process is running at full tilt,
and does not put itself to sleep (although it may yield the Processor),
if ObjectMemory quit is called, the system will wait forever for the
background process to terminate. This is polite, and seems a worthwhile
behaviour to preserve, but should it be the default? I expected
ObjectMemory quit to fairly smartly terminate the VM.


Example:



[| d count |
    d := Delay forMilliseconds: 500.
    count := 0.
    [
        count := count + 1.
        (count \\ 100) = 0 ifTrue: [
          Transcript << 'count: ' << count; nl.
          Processor yield.
        ].
    ] repeat.
] fork.
Transcript << 'quitting'; nl.
ObjectMemory quit.

Actual output:



count: 100
quitting

... and then it hangs, not using any CPU. (Which is in itself strange -
why isn't the loop continuing?)


Expected:



count: 100
quitting

... followed by a return to the unix shell.




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

Re: [bug] ObjectMemory quit waits for ever

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

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

The loop is continuing but stdin/stdout/stderr have been closed.  I will
change this to flushing stdin/stdout/stderr and closing the others.

Adding a Process>>#update: message like this (and calling it in the
program) fixes it, I will also do it.

    Process extend [
        update: aSymbol [
            aSymbol == #aboutToQuit ifTrue: [ self terminate ]
        ]

        terminateOnQuit [
            ObjectMemory addDependent: self
        ]
    ]

The default behavior however is not going to change for backwards
compatibility.

Thanks!




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

Re: [bug] ObjectMemory quit waits for ever

Paolo Bonzini
In reply to this post by Tony Garnock-Jones-4
Issue status update for
http://smalltalk.gnu.org/project/issue/152
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/152

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

fixed in patch-685




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