| Author |
synchronized vs ReentryReadWriteLock
|
Helen Ma
Ranch Hand
Joined: Nov 01, 2011
Posts: 451
|
|
1. sychronized (obj) means aquiring the lock of the object.
2. Consider the lock:
For synchronize keyword, it locks the object.
For lock, it does not lock any object. This lock is an indicator that indicates the code below it is mutal exclusive.
Is this true?
|
 |
Roel De Nijs
Bartender
Joined: Jul 19, 2004
Posts: 4355
|
|
First of all: ReentryReadWriteLock is an unexisting class in JDK. I guess you meant ReentrantReadWriteLock.
Secondly I think Anayonkar Shivalkar gave an excellent explanation about that part of the new concurrency api in this post.
|
SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
|
 |
 |
|
|
subject: synchronized vs ReentryReadWriteLock
|
|
|