Currently, MCOP is all single threaded. Maybe for video we will no longer be able to get around threading. Ok. There are a few things that should be treated carefully:
SmartWrappers - they are not threadsafe due to non-safe reference counting and similar.
Dispatcher / I/O - also not threadsafe.
However, what I could imagine is to make selected modules threadsafe, for both, synchronous and asynchronous streaming. That way - with a thread aware flow system, you could schedule the signal flow over two or more processors. This would also help audio a lot on multiprocessor things.
How it would work:
The Flow System decides which modules should calculate what - that is:
video frames (with process_indata method)
synchronous audio streams (calculateBlock)
other asynchronous streams, mainly byte streams
Modules can calculate these things in own threads. For audio, it makes sense to reuse threads (for example, render on four threads for four processors, no matter if 100 modules are running). For video and byte decompression, it may be more confortable to have a blocking implementation in an own thread, which is synchronized against the rest of MCOP by the flow system.
Modules may not use MCOP functionality (such as remote invocations) during threaded operation.
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team