interpreterProxy signalSemaphoreWithIndex:

tim Rowledge tim at rowledge.org
Sat Jun 10 01:20:17 UTC 2006


On 9-Jun-06, at 5:12 PM, Andreas Raab wrote:

> 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

OK, I see your new function ok and I see what it does but after  
scanning the entire platorms tree I can't spot where you might be  
overriding the 'normal' signalSemaphoreWithIndex. What did I miss or  
misunderstand ?

If the issue is important for internal use (as intimated in your  
comment in sqWin32Window.c then perhaps we should make sure that the  
interp.c code can take advantage of a platform specific function  
where appropriate.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- Sailboat fuel for brains.





More information about the Squeak-dev mailing list