--Daniel--
Not only are you right, but the example was chosen such that it does not matter. I.e. a few stale search results isn't a huge deal in the context of that application.
A more detailed intro is already on the errata for the book, not sure that's been made public yet.
The key to the example is the fact that it's *consistent* to use the stale immutable index, while the mutable index forces you to lock, even if you don't mind staleness otherwise.
A lot of search indices lag live results in such a fashion, aiming for "eventual consistency". The technique outlines how such a thing is possible using immutable data structures, but much harder with mutable ones.
Basically, not every concurrency problem devolves into "I must know exact state now". Some allow previous *but consistent * state.
Not only are you right, but the example was chosen such that it does not matter. I.e. a few stale search results isn't a huge deal in the context of that application.
A more detailed intro is already on the errata for the book, not sure that's been made public yet.
The key to the example is the fact that it's *consistent* to use the stale immutable index, while the mutable index forces you to lock, even if you don't mind staleness otherwise.
A lot of search indices lag live results in such a fashion, aiming for "eventual consistency". The technique outlines how such a thing is possible using immutable data structures, but much harder with mutable ones.
Basically, not every concurrency problem devolves into "I must know exact state now". Some allow previous *but consistent * state.
--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.