headless vm changes suggestions

Tim Rowledge rowledge at interval.com
Fri Mar 20 19:04:37 UTC 1998

On Fri 20 Mar, Georg Gollmann wrote:

> Does this mean that the image HAS to know whether it runs headless
or not ?
No, not at all. If you were to change the startup sequence to check
for some flag for head/nohead, you could simply do/not-do the
#beDisplay. The image would still be able to think of itself as
having a Display form, but the VM would not have been told about it
and so no window would appear and no attempt to call ioShowDisplay()
would occur. There may be some issues about the event loop for some
machines and situations.
> For my current applications it is very convenient to have a single
> that runs unchanged either with or without a window.
Sounds fine to me. For you a suitable flag for headlessness might be
the existence of a certain file, or maybe an environment variable, or
maybe some #getAttribute: result that refelcts a command line option
for the VM. It's up to you. I think this is the key point of my
suggestion; it is simply a mechanism to allow the VM to not open a
'real' window until and unless you want one.
To extend the point a little, a headless image could still open a
window if some error ocurred that needed attention, by adding the
send of #beDisplay somewhere in the Notifier opening. I guess one
might want to keep an image flag indicating whetheror not the window
had already been opened.
Of course, with more advanced work, the notifier might choose to use
a socket to inform some remote machine of the problem and keep the
image headless.
> So it´s "your mileage may vary", I guess.
Most definitely. With the suggested VM changes, nobody would even
notice the difference in a 'normal' image.

Useful random insult:- Watching programs not listed in TV Guide.
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 856-7230 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>

More information about the Squeak-dev mailing list