<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Marcel,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 28, 2020 at 6:42 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_4132064452308406991__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        Hi Dave!<div><br></div><div>Thanks. :-)</div><div><br></div><div>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.</div></div></div></blockquote><div><br></div><div>It's not just overkill, it is wrong.  This is a very important issue.  Here's an example:</div><div><br></div><div><div>shutDown: quitting</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span>quitting ifTrue: [</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">             </span>ScorePlayer allSubInstancesDo: [:ea | [ea stopMIDIPlaying] on: Error do: [] ] ].</div></div><div><br></div><div>This in fact should be done on the startUp: side.</div><div><br></div><div>If there is an alternative implementation it would be something like this:</div><div><br></div><div><div style="color:rgb(0,0,0)"><div>ScorePlayer class>>shutDown</div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">     Smalltalk for: self addVeryEarlyStartupAction: [</span>ScorePlayer allSubInstancesDo: [:ea | [ea stopMIDIPlaying] on: Error do: [] ] ]</div><div><br></div><div>where the early startup actions would be executed before the rest of the startup actions.</div><div><br></div><div>But better is, I think, to start-up by</div><div><br></div><div>- first suspending any and all runnable processes except the current process, the finalization process, and maybe the low space process, to stop any actions left from the snapshot occurring until after start-up is complete</div><div>- run the startUp: actions, having moved things like ScorePlayer class>>shutDown's body to ScorePlayer class>>startUp:</div><div>- carefully consider the ordering of start-up actions (having a pragma based scheme <dependsOn: #ClassName> would allow automatic sorting of the list in a rational way)</div><div>- resume any processes suspended before start-up</div><div><br></div><div><br></div></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_4132064452308406991__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)"><div><br></div><div>What's the underlying best practice? :-)</div><div><br></div><div>Best,</div><div>Marcel</div><div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 28.05.2020 15:26:09 schrieb David T. Lewis <<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">On Wed, May 27, 2020 at 08:58:48AM +0200, Marcel Taeumel wrote:<br>> Hi, there. :-)<br>> <br>> 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(:))?<br>> <br>> ...or am I missing something? Tim (tpr)! You started it in 2003. Please, explain.??:-D<br>> <br>> Maybe ... we don't ever want to store dangling source-file handles in the image?<br>> <br><br>Yes I think that is the reason. The image snapshot should contain little or<br>no platform-specific stuff, and there is no point in allowing it to contain<br>obsolete file handles that would need to be detected by primitive fallback<br>code when the snapshot is next loaded.<br><br>After all, the image that you snapshot today may next be opened by someone<br>with a Risc OS computer :-)<br><br>Dave<br><br></div></blockquote>
                                        </div></div><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div></div>