interpreterProxy signalSemaphoreWithIndex:

Andreas Raab andreas.raab at gmx.de
Sat Jun 10 00:12:59 UTC 2006


John M McIntosh wrote:
> Likely I should point out this code is not 100% percent thread safe.
> 
> People doing thousands of signal events per second from an async thread 
> should think carefully about the code.
> 
> This becomes a bit more of a problem given 4GHz machines with dual or 
> quad processors.
> The original solution to the problem I posted many years ago used a 
> semaphore, but I was told those don't exist on some platforms so the 
> current code does not do thread safe locking of any form.

There is a very simple solution to that problem which I implemented 
quite a while ago: Simply make a platform-specific version of 
signalSemaphoreWithIndex (in the Win32 VM that version is found in 
sqWin32Window.c under the name of synchronizedSignalSemaphoreWithIndex) 
and override the function in the VM proxy. Simple and direct.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list