[m-rev.] for review: [PATCH 1/4] Add thread_safe attribute to store procedures.

Paul Bone paul at bone.id.au
Tue Jul 22 15:05:20 AEST 2014


On Tue, Jul 22, 2014 at 03:00:23PM +1000, Peter Wang wrote:
> The mutvar procedures are not truly thread-safe but neither does
> obtaining a global lock make them become thread-safe in a useful way,
> except perhaps avoiding data races.  On the other hand, the global lock
> inhibits parallelism in programs that do use mutvars in a thread-safe
> manner.

This seems to be one of those changes that doesn't "fix" something but that
does make it "better".  So I think we should accept this change because it
improves things even though they're not perfect.

However, There should be a big loud warning at the top of this module
telling users that this is not thread safe, and that sharing a store between
threads may result in undefined behaviour.

(Undefined behaviour may include colliding of hadrons and the summoning of
Kathulu.)


-- 
Paul Bone



More information about the reviews mailing list