Open preaction opened 8 years ago
They absolutely could not be a hierarchy: When decrementing a parent node, which child node gets it?
Wecould make it so everyone who connects is an "increment", and sends a message to everyone else with the current number of connected clients. Disconnecting decrements the counter (and reports that to other clients).
SysV semaphores are shared counters. Anyone can increment/decrement them, and everyone gets the result of the increment/decrement. The counter is held and any new member joining the pool gets the same value.
We could also make this hierarchal, like pub/sub.
Use-cases:
Downsides: