[Vm-dev] Events handling for SqueakGtk

David T. Lewis lewis at mail.msen.com
Sat Jul 12 11:59:03 UTC 2008


On Fri, Jul 11, 2008 at 01:30:43PM +0200, Bert Freudenberg wrote:
> >To solve this problem I'll create a C thread and say to the vm  
> >change the status of the current process
> >call the blocking method and when there is an event wake up the  
> >process to say I've finished my work.
> >
> >Is there a way to solve this problem ?
> 
> 
> The canonical way to do this is have the Smalltalk process wait on a  
> Semaphore, and signal that Semaphore from the VM if there is anything  
> to do. See senders of "Smalltalk registerExternalObject:  
> someSemaphore" for examples.

The SocketPlugin uses this technique, and you can find additional examples
in AioPlugin (notify a Smalltalk process on IO activity) and OSProcessPlugin
(notify a Smalltalk process on termination of an external process). These
are on SqueakMap/SqueakSource.

Dave
 


More information about the Vm-dev mailing list