Respondida agents: message block send to all targets?

  • lunes, 16 de julio de 2012 10:53
     
      Tiene código

    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
    

Todas las respuestas

  • lunes, 16 de julio de 2012 16:06
     
     Respondida

    You can use the overwrite_buffer which has broadcast semantics.

    --Krishnan (Microsoft).


    --Krishnan (Microsoft)

    • Marcado como respuesta Dragon89 martes, 17 de julio de 2012 6:58
    •