Up to Main Index Up to Journal for August, 2017 JOURNAL FOR SUNDAY 13TH AUGUST, 2017 ______________________________________________________________________________ SUBJECT: Not all fun and games DATE: Mon 14 Aug 00:26:40 BST 2017 While working on WolfMUD recently a thought struck me, it didn’t hurt — I’m okay, but it did make me pause and think for a bit. If I am having so much trouble working on WolfMUD, specifically data races, how on earth is anyone else going to deal with working on the code? Just as important, the last few months working on WolfMUD have been one huge, difficult and frustrating slog. Working on WolfMUD should be fun, otherwise why would I do it? It shouldn’t make me miserable. The lack of fun was why I stopped working on the Java version many years ago. With the addition of resets and respawns, and the subsequent attempts to fix the data races it caused, the code has become overly complex, convoluted and plain messy. Somehow I need to unravel the mess and simplify things again, which is not going to be an easy task. I’m not giving in — it’s still just a programming challenge. I need to stop tinkering with the code trying to get it working. What I need to do is fix the root cause of the problem. What I need is a plan! At the moment I am working on two ideas. The first idea is to introduce an attic for Inventory types. The attic is a place where items that are currently out of play can be stored. This ensures that all items are covered by a lock — even when not in play. It is also possible to find out where an item in an attic is, as the Where method will still refer to the Inventory the attic is associated with. This idea seems to be panning out quite well. The second idea is to rework and simplify resets and respawning. This idea is not panning out and giving me all sorts of grief. So much grief in fact that it might be easier to revert the changes and have a second attempt at it. I have a third idea which is currently simmering away in the back of my mind. That involves removing the BRL — big room lock — and making all of the types concurrent safe. This is a similar approach to the one taken with the Locate attribute. However it seems to be a very inelegant solution that will require locks for everything — and I’ve no idea what the performance penalty would be. -- Diddymus Up to Main Index Up to Journal for August, 2017