[Vm-dev] InputSemaphore on Windows

Henrik Sperre Johansen henrik.s.johansen at veloxit.no
Sun Apr 18 00:24:45 UTC 2010

  On 16.04.2010 01:07, Andreas Raab wrote:
> On 4/15/2010 3:18 PM, Henrik Sperre Johansen wrote:
>> Is there a reason why this isn't signalled when inputSemaphoreIndex > 0?
> None. It just doesn't bite me. If it did I would've fixed it already. 
> Got patch?
Not yet, thought I'd ask the question if there was any good reason not 
to do so first :)
The reason I'd like it to be so, is that Pharo already includes a an 
EventSensor (InputEventFetcher) which relies on this, and abolishes the 
polling of EventSensor, but it's not used by default since 
InputSemaphore is not signaled on all VM's. The code should be easily* 
portable to Squeak as well.
>> In sqWin32Window.c, the comment for synchronizedSignalSemaphoreWithIndex
>> looks somewhat scary...
>> But looking at the svn logs, it seems it never was used in the
>> record...Event() functions at all, so I wondered if a problem was
>> encountered before svn was in use that lead to its removal, or if it's
>> just not done by default?
> The short answer is that there are so many potential issues with 
> handling semaphore signals properly that at some point I just gave up. 
> At this point, there is no reliable way to deliver semaphore signals, 
> they can and they *do* get dropped (we've proven that).
As far as I could read from the latest thread about it on the  Squeak 
list http://n4.nabble.com/More-Delay-Semaphore-fun-td67556.html#a67556, 
this is an issue mostly when the the waiting/signaling process is 
terminated, which would (probably... ) not be the case for an event fetcher.

If I get the time to make any progress** I'll send you the modified file 
for review.


*As in, I haven't done it, but the code should run on both platforms.
** Something buildable, which works as expected when InputEventSensor is 
active on Pharo

More information about the Vm-dev mailing list