FROM EXPERIENCE: in multi-threaded and multi-process code, it is best to avoid synchronisations where possible.
for example, instead of thread A wating on thread B,
instead have thread B only, and then thread B fires an event, that is handled by a 'new' thread A.
note: thread A may not be new: it may be taken from a thread pool.
in general, this seems better, because:
+ more efficient
+ less chance of deadlock
TODO: find some material to back this up.
for example, instead of thread A wating on thread B,
instead have thread B only, and then thread B fires an event, that is handled by a 'new' thread A.
note: thread A may not be new: it may be taken from a thread pool.
in general, this seems better, because:
+ more efficient
+ less chance of deadlock
TODO: find some material to back this up.
Comments
Post a Comment