I'm currently working on an application and I need a way of managing errors across several threads.
The current decision I'm attemping to reach is which structure would be the correct to use for my application. The process works like a simple producer/consumer loop, with the exception that multiple items will not get queued (since an error that cannot be handle will be sent to the error reporting thread), and an error that can be handled is just sent as no error.
So my current decision falls to a notifier vs a subroutine. I'm on the fense about which would be the proper one to use. Time is very critical since this will execute on the communication thread (which generally needs to execute as fast as possible).
What I'm in the dark about is how a notifier and subroutine fully work. The questions I sort of need answered are.
1) Does the read operation of a notifier block? If so is it only when another thread is writing?
2) I know a subroutine blocks until it is no longer being called elsewhere. But does it execute if it is not being called elsewhere? I do not what one to end up consuming to much CPU time.