On Wed, Jul 02, 2003 at 11:27:22PM -0700, John M McIntosh wrote:
Besides, signalling the event semaphore from the VM will only work if you have a multi-threaded VM implementation which can process incoming UI events in parallel to the VM's loop. If you don't, then you'll only get new events every 500ms or so (depending on what your VM interrupt check counter says) so not stimulating the input semaphore is not an option given all the non-multithreaded implementations.
Well yes the mac os-x VM is a muti-threaded VM that has a separate thread for the UI events. That's part of the carbon/cocoa event model. In fact the UI thread uses pthread locking to deposit events onto the Squeak VM thread.
As an aside, the Unix VM with an X display could probably be made to do this without resorting to pthreads. All external events are going to originate from one of: 1) external files 2) sockets 3) events originating from the X server (which arrive on a socket channel) 4) OS signals
The first three can all be handled by the aio mechanism in Ian's VM, and the forth can be handled in the obvious way. All four can therefore trigger a Squeak Semaphore, and no VM level threads would be required.
Dave