
Signature
Patrick Philippot - Microsoft MVP [.Net]
MainSoft Consulting Services
www.mainsoft.fr
> > can anyone tell me what the .Net equivalent of CRITICAL_SECTION is,
>
> Use System.Threading.Mutex.
Works lovely, thank you !
>> can anyone tell me what the .Net equivalent of CRITICAL_SECTION is,
>
> Use System.Threading.Mutex.
The correcter equivalent is Monitor.Enter/Exit
or in C# the "lock" keyword, which results in:
<code>
object obj1;
Monitor.Enter(obj1 = lockObject);
try
{
// do some snychronized stuff
}
finally
{
Monitor.Exit(obj1);
}
</code>

Signature
Greetings
Jochen
Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Do you need daily reports from your server ?
http://sourceforge.net/projects/srvreport/
Jochen Kalmbach - 19 May 2004 13:40 GMT
>>> can anyone tell me what the .Net equivalent of CRITICAL_SECTION is,
>>
>> Use System.Threading.Mutex.
>
> The correcter equivalent is Monitor.Enter/Exit
by the way: The difference is performance!
Mutex can be used across processes (CriticalSections not, neither Monitor).

Signature
Greetings
Jochen
Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp
Do you need daily reports from your server ?
http://sourceforge.net/projects/srvreport/