Click here to Skip to main content
15,917,005 members
Home / Discussions / C#
   

C#

 
GeneralXML Database Pin
surfman1919-Aug-05 11:02
surfman1919-Aug-05 11:02 
GeneralRe: XML Database Pin
rudy.net19-Aug-05 13:52
rudy.net19-Aug-05 13:52 
GeneralLock question Pin
Steve Messer19-Aug-05 10:59
Steve Messer19-Aug-05 10:59 
GeneralRe: Lock question Pin
Guffa19-Aug-05 22:19
Guffa19-Aug-05 22:19 
GeneralRe: Lock question Pin
Steve Messer20-Aug-05 4:58
Steve Messer20-Aug-05 4:58 
GeneralRe: Lock question Pin
Guffa20-Aug-05 13:31
Guffa20-Aug-05 13:31 
GeneralRe: Lock question Pin
Steve Messer20-Aug-05 13:48
Steve Messer20-Aug-05 13:48 
GeneralRe: Lock question Pin
Guffa21-Aug-05 1:23
Guffa21-Aug-05 1:23 
Of course it's thread safe. This is one of the mechanisms used to make things thread safe.

The documentation says that the waiting process does not get access to the code until you have ended the same number of locks that you started. That means that the system keeps track of the number of locks, otherwise the waiting process would get access to the code when you ended the innermost lock.

I tried to investigated the Enter and Exit methods of Threading.Monitor using .NET Reflector, but that did not reveal anything about the implementation. They are implemented internally in the CLR.

If you replaced the lock with something else, what is that then? Is that thread safe?

---
b { font-weight: normal; }

GeneralRe: Lock question Pin
Steve Messer21-Aug-05 2:43
Steve Messer21-Aug-05 2:43 
GeneralGDI+ Paths and Regions Pin
mpastchenko19-Aug-05 8:39
mpastchenko19-Aug-05 8:39 
GeneralRe: GDI+ Paths and Regions Pin
mpastchenko19-Aug-05 11:37
mpastchenko19-Aug-05 11:37 
GeneralLabel Graph Tick Mark Axis, Mistake Pin
...---...19-Aug-05 7:09
...---...19-Aug-05 7:09 
GeneralRe: Label Graph Tick Mark Axis, Mistake Pin
...---...19-Aug-05 7:13
...---...19-Aug-05 7:13 
GeneralRe: Label Graph Tick Mark Axis, Mistake Pin
Guffa19-Aug-05 7:17
Guffa19-Aug-05 7:17 
QuestionHow2 assign specific class type to generic object type? Pin
Dennis McMahon19-Aug-05 7:08
Dennis McMahon19-Aug-05 7:08 
AnswerRe: How2 assign specific class type to generic object type? Pin
AndrewJMarshall19-Aug-05 7:36
AndrewJMarshall19-Aug-05 7:36 
GeneralRe: How2 assign specific class type to generic object type? Pin
Dennis McMahon19-Aug-05 8:01
Dennis McMahon19-Aug-05 8:01 
GeneralDataGrid bounded to a DataTable with composite key. Pin
miah alom19-Aug-05 6:55
miah alom19-Aug-05 6:55 
GeneralRe: DataGrid bounded to a DataTable with composite key. Pin
rudy.net19-Aug-05 13:35
rudy.net19-Aug-05 13:35 
GeneralRe: DataGrid bounded to a DataTable with composite key. Pin
miah alom21-Aug-05 6:01
miah alom21-Aug-05 6:01 
QuestionAUTO UPDATE?? Pin
cyrus_thevirus19-Aug-05 5:27
cyrus_thevirus19-Aug-05 5:27 
AnswerRe: AUTO UPDATE?? Pin
Mohamad Al Husseiny19-Aug-05 6:19
Mohamad Al Husseiny19-Aug-05 6:19 
GeneralRe: AUTO UPDATE?? Pin
cyrus_thevirus19-Aug-05 6:41
cyrus_thevirus19-Aug-05 6:41 
GeneralRe: AUTO UPDATE?? Pin
ekynox19-Aug-05 17:01
ekynox19-Aug-05 17:01 
GeneralFile Copy from remote server Pin
NitinR19-Aug-05 5:19
NitinR19-Aug-05 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.