Light-weight monitor implementation?

stéphane ducasse ducasse at iam.unibe.ch
Thu Nov 3 11:52:50 UTC 2005


Andreas

did you got a look at the new "monitor" (I could find it arghh) class  
of lex that we pushed in 3.9a. Marcus do you remember the name
of this class? We pushed it so that people can test it and let us know.

For the complexity I would of course prefer something simple. After I  
know that nathanael is really excellent in terms
of concurrent programming.

Stef


On 3 nov. 05, at 08:49, Andreas Raab wrote:

> Hi Folks,
>
> I was looking for a simple monitor implementation (e.g., a  
> mechanism for mutual exclusion which allows the same process to  
> enter it multiple times) and looked at the implementation of  
> Monitor that is present in 3.9. Much to my surprise, I found that  
> this monitor implementation is a very heavyweight version of what  
> should essentially be three methods, e.g., #enter, #leave, and  
> #critical:. The extra heavy-weight behavior might be useful in  
> certain specific cases but I wonder about its general applicability  
> (personally I find it more confusing than helpful because it hides  
> the nature of a monitor under a lot of extra baggage). I think it  
> would be tremendously useful to do a little refactoring which a)  
> makes a tiny class Monitor and b) makes a heavy-weight EventMonitor  
> which has all the extra stuff (timeout, events) that is now in  
> Monitor.
>
> What do other people think? Is there any reason for Monitor being  
> such a heavy-weight object by default? Is it necessary that a  
> monitor support all of the extra functionality besides the basic  
> "allow a process to enter it multiple times"?
>
> Cheers,
>   - Andreas
>
>




More information about the Squeak-dev mailing list