Random Chitchat 2012-2016
Would anyone be interested in helping to build a lock hierarchy for for cuberite? I was trying to build a patch for a potential deadlock Seadragon91 spotted with the clang thread sanitizer, and I couldn't work out whether the change I wanted to make would cause other deadlocks.
Thanks given by:
Also could we eliminate cCSUnlock by providing a cEvent.Wait(Lock) overload which unlocks the lock whilst it is waiting? Then we could use clangs thread safety annotations to help avoid deadlocks. There are are only two places in the codebase that are using cCSUnlock around something else.
Thanks given by:
What kind of help do you need? Coding? Debugging? Something else?
Thanks given by:
More just would anyone else use/follow it. If we do it in code, would the PR be accepted, given tools like clangs thread sanitizer provide the same guarantees. And if we did it outside the codebase, would it actually be used/followed, given how easy it is to call a method that calls a method that calls a method which takes a lock.
Thanks given by:
I don't think we could ever build a proper hierarchy, because of plugins. Each plugin has a lock and can acquire the world lock during its execution, and on the other hand world ticking does call into plugins while the world lock is held. I don't see a simple way out of this.
Thanks given by:
We could however ensure that c++ code follows the hierarchy. And really we should have runtime checks causing API calls to fail if plugins don't follow the hierarchy.
Thanks given by:
They're on to me!


Attached Files Thumbnail(s)
   
Thanks given by: LogicParrot
Debug builds suddenly got a LOT more verbose. What's up with that?
Thanks given by:
The new Redstone simulator is spamming the console in debug mode.
Thanks given by:
I got a message from the hotel slipper seller (ref.: https://forum.cuberite.org/showthread.ph...2#pid23922 ), they won't be making custom logo-ed ones for an order this small Sad Pity, I wanted at least something Cuberite-specialTongue
Thanks given by:




Users browsing this thread: 99 Guest(s)