int main(int argc, char** argv) { if (argc != 4) { usage(); } enum { invalid_impl, push_impl, send_impl } impl = invalid_impl; if (strcmp(argv[1], "push") == 0) impl = push_impl; else if (strcmp(argv[1], "send") == 0) impl = send_impl; else usage(); auto num_sender = rd<int64_t>(argv[2]); auto num_msgs = rd<int64_t>(argv[3]); Receiver r; t_max = num_sender * num_msgs; auto receiverAddr = r.GetAddress(); Framework framework(num_cores()); ActorRef aref(framework.CreateActor<receiver>()); std::list<std::thread> threads; auto impl_fun = (impl == push_impl) ? send_sender : push_sender; for (int64_t i = 0; i < num_sender; ++i) { threads.push_back(std::thread(impl_fun, std::ref(framework), aref, receiverAddr, num_msgs)); } r.Wait(); for (auto& t : threads) t.join(); return 0; }