Up to Main Index                          Up to Journal for February, 2022

                    JOURNAL FOR SUNDAY 6TH FEBRUARY, 2022
______________________________________________________________________________

SUBJECT: Plan B salvaged and back on the table
   DATE: Sun  6 Feb 19:12:39 GMT 2022

I decided that yesterday’s journal entry was not very convincing, it didn’t
have me convinced at any rate. There should be no reason why events cannot be
scheduled for players. Also, if the BWL was being taken why was there still a
data race? Something just didn’t add up…

I’ve spent all afternoon carefully going over my code, debugging and testing.
How can you take a lock and still have a data race? Easily, you modify the
data somewhere else without taking the lock of course! I finally tracked down
the culprit in the client code — the client.cleanup function was accessing the
player without taking the BWL. This then caused the data race I saw when the
event then fired and accessed the player. The fact that the event fired after
the player was removed from the world is another problem I’m looking into.

I’ve implemented a fix and the server has been stable with no data races for a
few hours now. It looks like plan B is back on the table again :)

I’ve managed to reduce the number of simultaneously registered events. I have
a server running tests with 1,024 bots running around and hitting each other
with only an additional 10-20 events queued. Testing under the race detector
is painful — with only 1,024 bots the server hits about 2.4Gb RAM.

I have to finish testing, clean up the code and get everything committed into
the repository. It’s not quite full blown combat yet, but I’m getting there…

--
Diddymus


  Up to Main Index                          Up to Journal for February, 2022