Answered agents: message block send to all targets?

  • lunedì 16 luglio 2012 10:53
     
      Contiene codice

    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
    

Tutte le risposte

  • lunedì 16 luglio 2012 16:06
     
     Con risposta

    You can use the overwrite_buffer which has broadcast semantics.

    --Krishnan (Microsoft).


    --Krishnan (Microsoft)

    • Contrassegnato come risposta Dragon89 martedì 17 luglio 2012 06:58
    •