ReadWriteUpgradeLock

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ReadWriteUpgradeLock

Moran Avigdor
Hi,
    I was looking for something similar to ReadWriteUpgradeLock in the concurrency package.
    see: http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/ReadWriteUpgradeLock.html

    Upgrading from a read lock to a write lock with java.util.concurrent.locks.ReentrantReadWriteLock is not possible unless the read lock
    is released. This entails that if conditions were met prior to the write lock, they need to be re-checked.

    Is there a way, so that a thread that holds a read lock can acquire a write lock without releasing the read lock first?

    Thanks in advance.
Moran Avigdor R&D Engineer
Cell: +972 54 2112783
[hidden email]
www.gigaspaces.com




_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: ReadWriteUpgradeLock

tpeierls
If you find yourself rolling your own read-to-write upgradeable lock, you might find it useful to go through some earlier discussion on a related topic on this list. A reasonable starting point is http://altair.cs.oswego.edu/mailman/private/concurrency-interest/2005-February/001341.html -- not much progress since then, sad to say.

--tim

On 5/16/06, Moran Avigdor <[hidden email]> wrote:
Hi,
    I was looking for something similar to ReadWriteUpgradeLock in the concurrency package.
    see: <a href="http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/ReadWriteUpgradeLock.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://jakarta.apache.org/commons/transaction/apidocs/org/apache/commons/transaction/locking/ReadWriteUpgradeLock.html

    Upgrading from a read lock to a write lock with java.util.concurrent.locks.ReentrantReadWriteLock is not possible unless the read lock
    is released. This entails that if conditions were met prior to the write lock, they need to be re-checked.

    Is there a way, so that a thread that holds a read lock can acquire a write lock without releasing the read lock first?

    Thanks in advance.
Moran Avigdor R&D Engineer
Cell: +972 54 2112783
[hidden email] <a href="http://www.gigaspaces.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.gigaspaces.com


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest