SyncLock (Lock)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hey guys.

I come from a Java background and I'm familiar with monitors in java.

I ahve been reading about the .net monitors, including the Lock loops, and I
came across a question.

In most .net examples, there is a specific object (usually just of type
object) upon which the CLR creates the monitor and it is this object is used
to ensure no concurrency.

For instance if I was using something in the collections class, in java I
would just lock on the queue/list/array/map etc to ensure thread safe
access. Why is it that the majority of examples use a separate object?


.



Relevant Pages

  • Re: SyncLock (Lock)
    ... I ahve been reading about the .net monitors, including the Lock loops, and I ... For instance if I was using something in the collections class, in java I ...
    (microsoft.public.dotnet.framework)
  • Re: Correct Semaphore Implementation in Java
    ... this isn't how I would have said monitors should ... describes enough different variations to make it ... "signal all waiting threads" operation -- notifyAll, ... Lea's "Concurrent Programming in Java" and Bloch's "Effective Java". ...
    (comp.lang.java.programmer)
  • Re: SyncLock (Lock)
    ... sometime you may have finer grain locking going on. ... is nothing wrong with locking on your list object if that is the only lock ... | I come from a Java background and I'm familiar with monitors in java. ...
    (microsoft.public.dotnet.framework)
  • Re: Multi-monitor test-and-feedback app for Windows
    ... and one of the reasons I wrote this test program. ... My own setup doesn't use transparent spanning, just Vista's run-of-the-mill virtual screen, although both monitors are connected to the same graphic card. ... I don't code any Java at this time, and in fact I've been wondering how all the other guys handle the multi-monitor problems. ...
    (comp.graphics.api.opengl)
  • Re: Monitoring native threads using JNI
    ... I have simple java application which monitors a directory (on ... there a way to listen or monitor a native thread. ... the notification from C++ code to java Code. ...
    (comp.lang.java.programmer)