
July 27th, 2009, 09:18 AM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 1
Time spent in forums: 1 m 52 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by George2 Hello everyone,
If I am using the ReaderWriterLock class, in the following 3 situations, except performance degrade, are there any functional issues? E.g. deadlock?
1. Acquire a specific write/read lock, and then acquire the write/read lock again, but release the write/read lock twice;
2. Acquire a specific read lock, and then acquire the write lock for the same object, and release in reverse order write lock, then read lock;
3. Acquire a specific write lock, and then acquire the read lock for the same object, and release in reverse order read lock, then write lock.
thanks in advance,
George |
-If you have a read lock, you can safely acquire another read lock.
-If you have a read lock, you CANNOT acquire a write lock (deadlock!).
-If you have a write lock, you can safely acquire another write lock.
-If you have a write lock, you CANNOT acquire a read lock (deadlock!).
Hope this helps
|