nim-chronos icon indicating copy to clipboard operation
nim-chronos copied to clipboard

disallow reentrancy

Open arnetheduck opened this issue 1 year ago • 1 comments

Reentrancy causes event reordering and stack explosions, in addition to leading to hard-to-debug scenarios.

Since none of chronos is actually tested under reentrant conditions (ie that all features such as exceptions, cancellations, buffer operations, timers etc work reliably when the loop is reentered), this is hard to support over time and prevents useful optimizations - this PR simply detects and disallows the behaviour to remove the uncertainty, simplifying reasoning about the event loop in general.

arnetheduck avatar Apr 25 '23 14:04 arnetheduck