-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Server Programmability
Interruptible waiting functionality implementation is currently split across the following types:
- waitable
- notifyable
- clocksource
- baton
- stdx::condition_variable
- interruptible
- operationContext
Waitable is a child class of Notifyable, and Baton is a child class of Waitable. ConditionVariable is a friend of Notifyable, and Waitable is a friend of ConditionVariable. Waitable only declares static methods used by ClockSource and OperationContext, except for two essential virtual functions that it declares that Baton must implement. These virtual functions are then called via a type-erased closure inside of condition variable.
The complicated relationships between these classes and division of functionality makes reading and understanding the code difficult and increases the risk that changes introduce subtle bugs due to the dependencies that are non-obvious. We should spend some time attempting to reduce the number of classes, inheritance structures, and friendships used to implement waitable interruptibility, to present a simpler interface that is more easily unit-testable.