August 2002
Intermediate to advanced
576 pages
13h 54m
English
The basic synchronization support in .NET is similar to that in Java. For advanced functionality, .NET goes into areas not covered by Java, exposing some sophisticated tools and fine-grain controls.
In Java, the keyword synchronized is used to ensure that only one thread will enter a specific section of code at a time. In the following example, Java ensures that a thread will not enter the code block containing the comment until an exclusive lock has been obtained on the this object.
public void doSomething() {
synchronized (this) {
// some synchronized operation
}
}When the thread exits the code section, Java will automatically release the lock so that another thread can attempt to acquire it and enter the synchronized ...
Read now
Unlock full access