Up to Main Index                              Up to Journal for June, 2017

                     JOURNAL FOR THURSDAY 29TH JUNE, 2017
______________________________________________________________________________

SUBJECT: Data races and a clean up message bug fixed
   DATE: Thu 29 Jun 21:59:57 BST 2017

Finally finished fixing and testing the data races I found in WolfMUD. The
code has seen days of runtime with thousands of player bots running around
without a single race for some time now.

In the end I went with the simple solution. The Thing type has been updated
with a read/write mutex to protect the Thing.attrs field which is a slice. The
Locate type — which is an Attribute — has been updated with a read/write mutex
to protect the Locate.where and Locate.origin fields.

These changes make it safe to find a Locate attribute and retrieve the value
of the Locate.where field outside of the normal state.sync locking. It does
mean that a sync.RWMutex has to be allocated for every Thing and every Locate,
which I’m still not too happy about — although based on the testing memory and
performance does not seemed to have suffered very much, but I haven’t measured
it.

While testing I spotted an item clean up bug. If you drop an item without a
custom clean up message the item just vanishes when it gets removed. Instead
it should be displaying the default clean up message. That’s been fixed now.

Changes for the data races and clean up bug are on the public dev branch.

This weekend should see a new release being rolled out. I missed last month
due to lack of time and little progress being made.

--
Diddymus


  Up to Main Index                              Up to Journal for June, 2017