On Tuesday, 5 June 2012 at 05:14:36 UTC, Nathan M. Swan wrote:
On Monday, 4 June 2012 at 11:17:45 UTC, Michel Fortin wrote:
After trying to make sense of the thread "synchronized
(this[.classinfo]) in druntime and phobos", I had to write my
opinion on all this somewhere that wouldn't be instantly lost
in a bazilion of posts. It turned out into something quite
elaborate.
<http://michelf.com/weblog/2012/mutex-synchonization-in-d/>
This encourages the bad practice (IMO) of shared data. Only a
single thread should have the dictionary, with an AddWordMsg
struct and a ConfirmWordMsg struct.
Using a message passing approach, the client thread sends an
AddWordMsg and continues while the word is added concurrently,
making it more efficient.
My non-expert opinion,
NMS
Though on the flip side, part of the D ideology is not
restricting the programmer to a single paradigm. So maybe I like
the idea :)
Data sharing should still be discouraged.
NMS