On Friday, 15 November 2013 at 16:36:56 UTC, Jacek Furmankiewicz wrote:
How can you achieve lock-free reads with the synchronized MyMap approach?

In this case you can use Readers-writer lock
http://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock

It allows multiple reads and single write. I think that the easiest way is use OS spesific function, for example `pthread_rwlock_t` for POSX. Note that D supports C ABI, so you can call any C function from D.

I don't know any D implementation of Readers-writer lock, but you can ask this question - maybe it already exist.

Reply via email to