interpreterProxy signalSemaphoreWithIndex:

David T. Lewis lewis at mail.msen.com
Sat Jun 3 13:27:32 UTC 2006


On Sat, Jun 03, 2006 at 01:06:30PM +0200, Bruno Luca wrote:
> Hello,
> I've seen that only UnixAioPlugin uses it (at least of internal plugins)  
> and that 'Unix' prefix
> doesn't really sound good to me :).
> So, does #signalSemaphoreWithIndex: work on Windows and other platforms?

The #signalSemaphoreWithIndex: method provides a general way to signal
a semaphore in the Squeak image from the VM. It works on any platform,
including of course Windows. This provides a very nice mechanism for
a Process in Squeak "wake up" when some external event happens.

If you look at UnixAioPlugin, you'll find that it's really a subclass
of AioPlugin, and that the an AioEventHandler (a class in OSProcess
that knows how to handle aio events) looks for primitives in the
plugin with moduleName 'AioPlugin'. It really does not know that it
is using the concrete implementation in UnixAioEventHandler.

The intent here is that when someone needs aio event handling for
Windows or for Risc OS, they will implement Win32AioPlugin or
RiscOSAioPlugin as subclasses of AioPlugin. When building AioPlugin
for Windows or RiscOS, VMMaker picks the right subclass to use,
and the result is an AioPlugin built with code generated from
Win32AioPlugin, RiscOSAioPlugin, or UnixAioPlugin depending on
the platform.

Anyway, back to your original question: #signalSemaphoreWithIndex:
is completely platform-independent and can be used on Windows
or any other OS.

Dave




More information about the Squeak-dev mailing list