Hi Alexandre:

On 24 Mar 2014, at 19:20, Alexandre Bergel <[email protected]> wrote:

> Any idea what is the cost of using a semaphore? Inserting the expression 
> "anOrderedCollection add: 42” in a semaphore surely make the expression 
> slower. Any idea how much slower?

Can you elaborate a little on the problem.
Your granularity does not seem to be of the right level.
Covering a single #add: operations is most probably rather fine grained, and 
might not give you the guarantees you would expect.
What exactly do you want to achieve?
How many Smalltalk processes are interacting with that collection? How many 
consumer/producer do you have?

And well, on the standard priority, you normally got cooperative scheduling 
anyway. So, it depends on what you are doing whether there is a real issue.
And if you don’t want to use a semaphore, there are also other mechanism. I 
think, there should be something like ‘execute uninterruptible’ for a block. 
Think that raises the priority of the processes to the highest level for the 
execution of the block, if I remember correctly.


Best regards
Stefan

-- 
Stefan Marr
INRIA Lille - Nord Europe
http://stefan-marr.de/research/




Reply via email to