RosaryMala / armok-vision

A 3d realtime visualizer for Dwarf Fortress
MIT License
319 stars 27 forks source link

Less lock contention in DFConnection #24

Closed kazimuth closed 8 years ago

kazimuth commented 8 years ago

It's not actually "lock free", like the branch name, but it's a lot closer than it was. Lock contention was adding 5-16 ms (!) to frames, for operations that should have been instantaneous ("enqueueing" things). Basically, DFConnection was locking things while talking to DF, and then GameMap had to wait for it to finish before it could update those things. Now, those operations are actually instantaneous.

Adds data structures from:

Future work: use concurrent queues when talking to BlockMesher.

Potential issue: dave-hillier/disruptor-unity3d is apache licensed. I added the license to the folder where it is (Assets/MapGen/Util); is it necessary to do anything else?

RosaryMala commented 8 years ago

You read my mind. I was literally looking into this last night.