> A simpler and guaranteed more reliable solution would be to move away from a
> pure callback approach (which we use in many places)...
>
> Instead, if we replaced such logic:
> call callback(args)
> with:
> signal event(args)
> then there is zero risk of deadlocks.
>
How would that be simpler? I guess simpler in which respect? Development, maintenance, usage?
A high level event-hub concept cannot guarantee zero deadlocks however, that's an implementation detail.
Maybe such an event hub could just post and dispatch events through the main loop to save a thread.
In any case, that's probably a much bigger re-factoring than what is proposed here.
> A simpler and guaranteed more reliable solution would be to move away from a
> pure callback approach (which we use in many places)...
>
> Instead, if we replaced such logic:
> call callback(args)
> with:
> signal event(args)
> then there is zero risk of deadlocks.
>
How would that be simpler? I guess simpler in which respect? Development, maintenance, usage?
A high level event-hub concept cannot guarantee zero deadlocks however, that's an implementation detail.
Maybe such an event hub could just post and dispatch events through the main loop to save a thread.
In any case, that's probably a much bigger re-factoring than what is proposed here.