interpreterProxy signalSemaphoreWithIndex:

Bruno Luca lethalman88 at gmail.com
Sat Jun 3 18:32:26 UTC 2006


On Sat, 03 Jun 2006 15:27:32 +0200, David T. Lewis <lewis at mail.msen.com>  
wrote:

> 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.
>

I didn't try any implementation yet, but i guess i need a threaded loop to  
check when a Semaphore has been signaled, right?

> 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.
>

Ok.

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

Oh ok, i think i've understood how it works basically: it just registers a  
signal by increasing a count into a C (or even a squeak-side) variable.

Thanks for your reply :)

-- 
www.lethalman.net - Thoughts about computer technologies



More information about the Squeak-dev mailing list