Are there any java collection wrappers/collections that fail upon multithreaded access? -
I am trying to track some concurrency problems related to collection in large code-base.
I would like to replace all the archives / maps with an alternative implementation which throws an exception when the third thread accesses it (or similar; I can work many potential strategies). Anyone know of any library / tools / strategies to do this?
I was thinking about replacing one search into the whole code-base and just try to "temporarily try to wrap a different" different version but a conscious map () and put ( ) Methods with ReentrantLock (or what you use):
java.util.concurrent.locks.ReentrantLock class X {Private Finals ReentrantLock Lock = New ReentrantLock (); Public Zero M () (If (Lock! LockLock ()) {// Pre-shutdown, hint: lock.isHeldByCurrentThread ()?} Lock.lock (); Try {// reps wrapped hashmap} Finally {lock .unlock ()}}
Comments
Post a Comment