Another perhaps style question:
How should concurrency be blocked? Should the agent or caller be responsible for blocking the flow?
eg. in any particular language ...
Caller::callAnotherThread() { _executor.method(); } Executor::method() { _lock(); doSomething(); _unlock(); }
OR
Caller::callAnotherThread() { _executor.lock() _executor.method(); _executor.unlock() } Executor::method() { doSomething(); }
I know little about streaming and blocking, so I want to make sure the code is reliable. The second method allows you to use unsafe thread calls ... you can technically call _executor.method () without any locks.
reference
Thanks,
Stephen Furlani
source share