Hi,
I would like to know if the following code is safe:
[SmalltalkImage current snapshot: true andQuit: false] forkAt: Processor userBackgroundPriority
Is there any problem if the main process modifies something in the same time ?
Thank you
2006/7/30, Damien Cassou damien.cassou@laposte.net:
Hi,
I would like to know if the following code is safe:
[SmalltalkImage current snapshot: true andQuit: false] forkAt: Processor userBackgroundPriority
Is there any problem if the main process modifies something in the same time ?
Doesn't thay stall the image anyway? IIRC it makes a full GC with blocks.
If you have OSProcess you can fork the image (search the mailinglist, Avi once asked about this). I don't know if this now works on Mac OS. Also pay attention that if you have two forked images at the same time, that they don't write into the same image file (if you want to use it for Pier). Otherwise you might end up with a corrupted image file.
Philippe
On Sun, Jul 30, 2006 at 03:04:58PM +0200, Philippe Marschall wrote:
If you have OSProcess you can fork the image (search the mailinglist, Avi once asked about this). I don't know if this now works on Mac OS. Also pay attention that if you have two forked images at the same time, that they don't write into the same image file (if you want to use it for Pier). Otherwise you might end up with a corrupted image file.
This is done by evaluating "UnixProcess saveImageInBackgroundNicely". The image will be saved by a copy of your Squeak image running in a separate OS process at low priority, with little or no impact on your main Squeak process.
It should also work on OS X if you are using the unix VM for OS X that supplies the OSPP plugin (I would appreciate if someone can confirm this). It might also work on the regular Mac VM if you compile your own OSPP plugin, but I'm not sure of this.
Dave
With the mac carbon 3 .8.12 series of VMs you can call any unix DLL you have handy. Thus if you have a Unix OSX version of the OSPP you can just use that, no need to compile a *.bundle.
On 30-Jul-06, at 8:25 AM, David T. Lewis wrote:
On Sun, Jul 30, 2006 at 03:04:58PM +0200, Philippe Marschall wrote:
If you have OSProcess you can fork the image (search the mailinglist, Avi once asked about this). I don't know if this now works on Mac OS. Also pay attention that if you have two forked images at the same time, that they don't write into the same image file (if you want to use it for Pier). Otherwise you might end up with a corrupted image file.
This is done by evaluating "UnixProcess saveImageInBackgroundNicely". The image will be saved by a copy of your Squeak image running in a separate OS process at low priority, with little or no impact on your main Squeak process.
It should also work on OS X if you are using the unix VM for OS X that supplies the OSPP plugin (I would appreciate if someone can confirm this). It might also work on the regular Mac VM if you compile your own OSPP plugin, but I'm not sure of this.
Dave
-- ======================================================================== === John M. McIntosh johnmci@smalltalkconsulting.com Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ======================================================================== ===
Damien Cassou wrote:
I would like to know if the following code is safe:
[SmalltalkImage current snapshot: true andQuit: false] forkAt: Processor userBackgroundPriority
Is there any problem if the main process modifies something in the same time ?
I'm sorry not having been clear enough. I just wanted to save the image when a user modify the model. To avoid a long delay for him, I wanted to use a fork.
But it seems this was not a good idea.
My solution is to remove the fork and let the user wait some seconds :-)
Thank you for all your explanations
On Jul 31, 2006, at 11:01 AM, Damien Cassou wrote:
Damien Cassou wrote:
I would like to know if the following code is safe: [SmalltalkImage current snapshot: true andQuit: false] forkAt: Processor userBackgroundPriority Is there any problem if the main process modifies something in the same time ?
I'm sorry not having been clear enough. I just wanted to save the image when a user modify the model. To avoid a long delay for him, I wanted to use a fork.
But it seems this was not a good idea.
My solution is to remove the fork and let the user wait some seconds :-)
Forking a separate Smalltalk process is a bad idea, but forking the whole unix process works just fine. You just need to modify the snapshot prim to do this. There was a long thread about this earlier, here's a post with some code:
http://lists.squeakfoundation.org/pipermail/squeak-dev/2005-October/ 095896.html
I used a VM with that prim for months without any ill effects.
Avi
squeak-dev@lists.squeakfoundation.org