• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronized search

 
Yemi Dalley
Greenhorn
Posts: 12
MyEclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I have a Map with Hotel Bookings as Cache ...

How did people implement search with Synchronization ?

Is the map locked while another thread is searching for Bookings ?

Should delete be possible during a search ?

In Andrew's book, there was no locking in the search algorithm, what if a thread deleted a record after a call to <Map>.keySet.iterator() ?

I'm just wondering if using reentrant.readWriteLock to lock for even searches is not going to impact significantly on the app.

Regards

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic