[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] OOP leaking with registered object
From: |
Roland Plüss |
Subject: |
Re: [Help-smalltalk] OOP leaking with registered object |
Date: |
Sun, 05 Apr 2015 17:41:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 04/05/2015 01:38 PM, Holger Hans Peter Freyther wrote:
> On Sun, Apr 05, 2015 at 12:16:36AM +0200, Roland Plüss wrote:
>
>> What you mean with shuting down all processes? As far as I know GST
>> knows only one process: the main process. When I'm outside the main
>> process should it not be the case that each call to gst_perform or
>> similar is conclusive, hence finishing up? So how would a finalization
>> listener work once you exit again the byte code? Similar how would
>> saving a snapshot work? There you have to also save the image and
>> somehow "exit" back into C++ land to shut down. Am I missing here something?
> I am referring to Smalltalk processes that continue to run. With
> spawning the "gst" application you have:
>
> st> Process allInstancesDo: [:each | each printNl]
> Process(nil at highIOPriority, terminated)
> Process('finalization listener' at timingPriority, waiting on a semaphore)
> Process('idle' at idlePriority, ready to run)
> Process('delay process' at timingPriority, waiting on a semaphore)
>
> So these processes run, they refer to objects. Now I don't know
> how many objects you want to be collected but you need to give up
> references and you need to make sure the finalization listener is
> woken up and runs
>
>
> 'finalization listener' process:
>
>
> initialize [
> ...
>
> finalizerProcess :=
> [[gcSemaphore wait. self startFinalizers] repeat]
> forkAt: Processor timingPriority.
> ...
> ]
>
>
> startFinalizers [
> "Private - Fire a low-priority process to finalize the objects"
> <category: 'idle tasks'>
> | local localFinalizerProcess |
> local := gcArray.
> gcArray := nil.
>
> localFinalizerProcess := [:array | array do: [:each | each mourn]]
> newProcessWith: {local}.
> localFinalizerProcess priority: Processor userSchedulingPriority.
> localFinalizerProcess name: 'finalization worker'.
> localFinalizerProcess resume
> ]
>
So I need to run this 'finalization listener' process somehow and this
cleans up? How would I trigger this from C++? And as a follow up
question would it not be better to just call a full garbage collection
run? After all there is only supposed to be one application object
holding all the script sources one way or the other. I drop the
reference of this one at exit time so a garbage collector run should
clean all up properly. How can I run such a fill garbage collection from
C++?
--
Mit freundlichen Grüssen
Plüss Roland
Leader und Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- Sowie verschiedene Blender Export-Skripts und Game-Tools
signature.asc
Description: OpenPGP digital signature
- [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/03
- Re: [Help-smalltalk] OOP leaking with registered object, Paolo Bonzini, 2015/04/03
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/03
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/04
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/04
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/05
- Re: [Help-smalltalk] OOP leaking with registered object,
Roland Plüss <=
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/06
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/07
- Re: [Help-smalltalk] OOP leaking with registered object, Holger Hans Peter Freyther, 2015/04/07
- Re: [Help-smalltalk] OOP leaking with registered object, Roland Plüss, 2015/04/08
- Re: [Help-smalltalk] OOP leaking with registered object, Paolo Bonzini, 2015/04/08