More synchronized ideas
Nathan M. Swan
nathanmswan at gmail.com
Mon Jun 4 22:14:34 PDT 2012
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
More information about the Digitalmars-d
mailing list