[Mono-devel-list] Question Threads and Locks

Paolo Molaro lupus at ximian.com
Tue Jan 18 13:17:21 EST 2005

On 01/18/05 Christoph Stiedl wrote:
>   On several places in the code there are "EnterCriticalSection"  
>   statements, but until now I couldn't figure out which things need to be  
>   protected when accessed and which not. It seems that only writing is  
>   protected by mutexes and not reading - am I right?  

It depends. Some structures can't change once inited, so they
don't need locking on read. Or there may be bugs. If you were
not so vague we could be of more help here (there could be also bugs
in this area, of course).

>   Which functions are called by multiple threads and which ones are called  
>   only by the starting thread --> to see which ones need synchronization  
>   --> or is synchronization only done by synchronizing the access to  
>   shared data structures. Which datastructures are shared?  


>   Is there any documentation about it?   

I think Zoltan wrote something about it when he reviewed the code, you
may want to google it. But it may be outdated, since it was a long time ago.
If you have any specific concern about some data structure, tell us.
We need to do a full audit for threading issues before the next release 


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list