Clusters, grids and Squeak

David T. Lewis lewis at mail.msen.com
Tue Apr 19 23:35:25 UTC 2005


On Tue, Apr 19, 2005 at 03:05:06PM +0200, Brent Pinkney wrote:
> Hi Dave,
> 
> >   | myWorkers p1 p2 worker messageFromSupervisor |
> >   myWorkers := (1 to: 95) collect: [:e |
> >     p1 := OSPipe nonBlockingPipe.
> >     p2 := OSPipe nonBlockingPipe.
> >     worker := UnixProcess forkHeadlessSqueakAndDoThenQuit:
> >         [(Delay forMilliseconds: 200) wait.
> >       messageFromSupervisor := p1 reader upToEnd.
> >       p2 writer nextPutAll: messageFromSupervisor.
> >       p2 writer nextPutAll: ' received by worker ',
> >         OSProcess thisOSProcess pid asString.
> >       p2 close].
> >       p2 closeWriter.
> >       p1 nextPutAll: e asString, ': hello to worker from coordinator ',
> >         OSProcess thisOSProcess pid asString.
> >       p1 close.
> >       Array with: worker with: p2].
> >   myWorkers do: [:w |
> >     Transcript show: w first asString, ': ', w second upToEnd; cr.
> >     w second close].
> >
> 
> I am really interested in this stuff - can you confirm that we worker  
> processes see the same memeory as the original ? What about database  
> connections.

They start with identical object memories, and gradually acquire their
own separate memory. It's just plain old Unix fork() behavior, but it
turns out to be an easy way to start images quickly and use only a
small amount of memory to get things started.

As for database connections, most likely they would get "reused," which
would be a Really Bad Thing. If you try this, you will want to decide
which Squeak image "owns" any particular database connection, and make
sure the other Squeak images close their copy of the connection and
start a new one.

> I would try it but will not have a Unix Squeak until next week at the  
> earliest.

Have fun,
Dave




More information about the Squeak-dev mailing list