[squeak-dev] Files | #startUp and #shutDown in FileDirectory

David T. Lewis lewis at mail.msen.com
Thu May 28 15:47:39 UTC 2020


Hi Marcel,

I don't really know the answer, but I would suggest to think of it in
terms of what things you want to store in the actual snapshot file.
If something like the GPU-state is safe to store, in the sense that it
will cause no harm for someone trying to load the same image file, then
maybe it is just a tradeoff between space wasted in the snapshot versus
the time it takes to recover state in your running image after doing
a snapshot.

In the case of the source files, it is simple because reopening the
source files it easy and has no performance implications. But for
something complex such as GPU-state, you might want to adopt a different
policy.

In the back of my mind I am also thinking of image snapshot objects
that can be transmitted over the network with no disk-based files,
e.g. http://www.squeaksource.com/ImageSnapshot. That would suggest
that when in doubt it is best to err on the side of cleaning up the
garbage before doing a snapshot.

Dave

On Thu, May 28, 2020 at 03:42:11PM +0200, Marcel Taeumel wrote:
> Hi Dave!
> 
> Thanks. :-)
> 
> Considering a bigger but similar, maybe FFI-based, mechanism, do you think it makes sense to clean up such things on a fresh startup only instead of every snapshot? Think of flushing the entire GPU-state you are currently managing just to retain some other in-image object. Seems overkill.
> 
> What's the underlying best practice? :-)
> 
> Best,
> Marcel
> Am 28.05.2020 15:26:09 schrieb David T. Lewis <lewis at mail.msen.com>:
> On Wed, May 27, 2020 at 08:58:48AM +0200, Marcel Taeumel wrote:
> > Hi, there. :-)
> >
> > Why do we reset file-related stuff (e.g. source file handles, default directory class)?? on every snapshot? Shouldn't there be a check for "resuming" (or "quitting") in FileDirectory class >> #startUp(:) (and #shutDown(:))?
> >
> > ...or am I missing something? Tim (tpr)! You started it in 2003. Please, explain.??:-D
> >
> > Maybe ... we don't ever want to store dangling source-file handles in the image?
> >
> 
> Yes I think that is the reason. The image snapshot should contain little or
> no platform-specific stuff, and there is no point in allowing it to contain
> obsolete file handles that would need to be detected by primitive fallback
> code when the snapshot is next loaded.
> 
> After all, the image that you snapshot today may next be opened by someone
> with a Risc OS computer :-)
> 
> Dave
> 

> 



More information about the Squeak-dev mailing list