[Vm-dev] OSProcess forkSqueak partially working on Cog now

David T. Lewis lewis at mail.msen.com
Thu Dec 16 15:56:09 UTC 2010


Eliot,

I've made some progress in getting OSProcess forkSqueak working with Cog.

What works: No VM crashes. Forking headless Squeak works properly. All
OSProcess and CommandShell unit tests green (but with intermittent errors).

What does not work: Display window does not open for child Squeak after a
forkSqueak. Intermittent failures in unit tests (but these are likely to
be problems in the tests and/or CommandShell, i.e. they are likely exposed
by but not caused by Cog).

The necessary changes (so far) are:

1) Several functions in sqUnixX11.c had been declared static. These are
used by XDisplayControlPlugin, so the static declarations must be removed.

2) In sqUnixHeartbeat.c, add a pthread_atfork() to restart the heartbeat
thread in the child VM process following a fork.

In addition to the platforms changes, the VM should include OSProcessPlugin,
AioPlugin, and XDisplayControlPlugin (not just the OSProcessPlugin alone).
These have all been been updated converted to use pragmas declarations, so
just take the latest version of each from:

  http://www.squeaksource.com/OSProcessPlugin
  http://www.squeaksource.com/AioPlugin
  http://www.squeaksource.com/XDCP

I am attaching patched platform files. With these patches in place, a
"UnixProcess forkSqueak" produces a working child VM process with a
running heartbeat thread. The child also has a new socket connection
to the X server, although the display itself does not appear to be
getting mapped for the child Squeak.

As far as the failure to open a new X display, I suspect I'm missing
something simple, but I haven't spotted what it is. If I can figure
that out, I think we'll have a fully working forkSqueak. Mean time,
these two platform file patches are enough to fix the main part of
the problem.

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patches_for_forkSqueak.tgz
Type: application/x-gtar
Size: 61600 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101216/45ebb015/patches_for_forkSqueak-0001.tgz


More information about the Vm-dev mailing list