0

Suppose we have a cache with a CacheLoaderWriter, so we are registered to the events: write and writeAll.

What is the status of these keys at that time?

i.e. If another thread tries to cache.get(keyThatBeingWritten), will it be blocked until the write()/writeAll() operations exit?

IsaacLevon
  • 2,260
  • 4
  • 41
  • 83

1 Answers1

1

writeAll() logically functions like a succession of write(), it is entirely possible for one thread to observe some already written data while another thread is still busy executing writeAll().

Regarding write(), it will block concurrent reader and writer threads working on the same key if needed for as long as needed to fulfill the Ehcache visibility guarantees.

Ludovic Orban
  • 396
  • 1
  • 6