Hi Jan, On 11 Dec 2013, at 12:49, Jan Vrany <jan.vrany@fit.cvut.cz> wrote:
Hi,
By default, no concurrent access protection takes place, but optionally a semaphore for mutual exclusion can be used. This slows down access.
cache useSemaphore.
There was enough "awesomes" already :-) so now some critics :-)
I like constructive feedback !
Wouldn't it be better to rename #useSemaphore to #beThreadSafe or #beSynchronized.
Yes, specifying the goal/result is better than specifying the means. I think I will go for #beThreadSafe (although threads in Pharo are called Processes ;-). The last one reminds me of Java and we donât have a âsynchronisedâ concept in Pharo AFAIK.
Also I would use recursion lock (monitor, if you like) rather than plain mutex.
Iâve used both, they both work. But I must admit that in my mind the difference is not very clear. A monitor can be re-entered while a semaphore cannot, but I doubt this is necessary here. Any other reasons to choose one over the other ? Speed ? Sven
Best, Jan