scala - Producer-Consumer: Should I synchronize read access -


consider producer-consumer problem, 1 producer , several consumers. consumers wait until told value has been produced. producer writes value , notifies consumers, read value. finally: consumers' , producer's termination synchronized using barrier. process repeats.

question: should provide exclusive access (e.g. synchronized) reading value consumers (or writing producer?). know obvious answer is: "seriously? no!" want make sure not missing weird detail.

if you're building concurrent application, recommend investigate akka. has offer , not trivial learn, pretty comprehensive far concurrency , distribution.

for particular case, data-flow variables might suit needs (and free overt synchronization!)


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -