Answered agents: message block send to all targets?

  • Monday, July 16, 2012 10:53 AM
     
      Has Code

    From what I've understood the existing message blocks (e.g unbounded_buffer) always propagate messages to the first target that accepts it. Is there a good way to "broadcast" messages to all targets?

    e.g.

    unbounded_buffer<int> source;
    unbounded_buffer<int> target1
    unbounded_buffer<int> target2;
    
    source.link_target(&target1);
    source.link_target(&target2);
    
    send(source, 1);
    
    std::cout << receive(target1);
    std::cout << receive(target2);
    
    // output: 11
    

All Replies

  • Monday, July 16, 2012 4:06 PM
     
     Answered

    You can use the overwrite_buffer which has broadcast semantics.

    --Krishnan (Microsoft).


    --Krishnan (Microsoft)

    • Marked As Answer by Dragon89 Tuesday, July 17, 2012 6:58 AM
    •