curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jordan Zimmerman <jor...@jordanzimmerman.com>
Subject Re: InterProcessReadWriteLock
Date Tue, 10 Sep 2013 22:19:45 GMT
> what happens if I attempt to acquire a write lock while there are read lock's in position?
The writer waits until all readers release.

> If the former, will it still block for the reader who's attempting to claim the writer?
Just like JDK locks, upgrading from a read lock to the write lock is not possible. That would
be a deadlock as the writer will wait indefinitely for the read to release.

-JZ

On Sep 10, 2013, at 5:10 PM, John Vines <vines@apache.org> wrote:

> Quick question about the behavior of the InterProcessReadWriteLock's locking behavior-
what happens if I attempt to acquire a write lock while there are read lock's in position?
Will it block until the reader's are released or will it attempt to revoke the reader's locks?
If the former, will it still block for the reader who's attempting to claim the writer?
> 
> Thanks
> John


Mime
View raw message