Originally posted by jiju ka:
So you are synchronizing on the reader or writer object?
What other options did you consider for locking. Can you please explain it.
I am currently thinking about implementing lock and unlock. I have some questions regarding that.
1. If you share a single instance of reader or writer, will performance become degraded. I will admit that the complexity is less and risk of dead lock is less thereby. Do we need to lose and open the reader or writer?
2. What is the bottle neck of having seperate reader/writer instances for each client thread - like using a connection pool or something?
3. Is the reader or writer analogous to connection in jdbc? If not what the analogy for connection here?
Most people lock on the whole record locking container(they use a container of locking numbers).