Question

I like the convenience of unbounded_buffer, but I also want to use this class on threads that concurrency runtime knows nothing about. In my tests it seems to work fine. Any potential problems with this approach?

Was it helpful?

Solution

Here's what I received from MSFT regarding the issue:

  1. Yes, you can use the message blocks (like unbounded_buffer) on thread that are manually created with CreateThread.

  2. Messages cannot traverse dll boundaries in that its allocation and deletion must occur in the same dll. Some message blocks like transformer allocates new messages. So they suffer from the same issue as well. unbounded_buffer> is perfectly fine to use except it doesn't solve the above issue. The type template argument refers to the payload type in the message (that is message). It is not the type of the envelope.

  3. In the steady state the throughput of a data flow network is very good. The main source of performance penalty is the linking and unlinking of message blocks when a network is being setup. In Visual Studio 2010 the message initiation commands such as send and asend suffered from this performance penalty. We have addressed this issue in the upcoming release of Visual Studio. There is no plan to back port the fix to VS2010. A potential workaround is to implement a simple ISource message block that is always connected to the dataflow network. Use this block to initiate messages into the network (The _Originator in agents.h is an example for an ISource block).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top