The two main sources of concern are the library and file states (= the sources of all evil…). Calling APIs that don’t change the file state in a callback should be fine. Calling APIs that change the file state may have knock-on effects, which are not apparent from the API.
W.r.t. coroutines, things might be more complicated. How do languages store/represent the execution state of coroutines? Different languages may implement that differently, and there might be even different implementations for the same language for different compilers. How do we know that successive execution states of coroutines are consistent with the file and library states?
Yes, we will try to be more precise here.
G.