From 1d423e3ceef05f936fa0717bb79c64e24a6e595b Mon Sep 17 00:00:00 2001 From: sageweil Date: Thu, 15 Mar 2007 23:12:32 +0000 Subject: [PATCH] * csyn: start up N synthetic clients, not just 1 git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1246 29311d96-e01e-0410-9327-a35deaab8ce9 --- trunk/ceph/csyn.cc | 55 ++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 21 deletions(-) diff --git a/trunk/ceph/csyn.cc b/trunk/ceph/csyn.cc index b5e4892cb9a6e..0f95ee56b2602 100644 --- a/trunk/ceph/csyn.cc +++ b/trunk/ceph/csyn.cc @@ -53,31 +53,44 @@ int main(int argc, char **argv, char *envp[]) { // start up network rank.start_rank(); - // start client - Client *client = new Client(rank.register_entity(MSG_ADDR_CLIENT_NEW), &monmap); - client->init(); + list clients; + list synclients; + + cout << "mounting and starting " << g_conf.num_client << " syn client(s)" << endl; + for (int i=0; iinit(); - // start syntheticclient - SyntheticClient *syn = new SyntheticClient(client); + // start syntheticclient + SyntheticClient *syn = new SyntheticClient(client); - // start up fuse - // use my argc, argv (make sure you pass a mount point!) - cout << "mounting" << endl; - client->mount(); - - cout << "starting syn client" << endl; - syn->start_thread(); + client->mount(); + + syn->start_thread(); + + clients.push_back(client); + synclients.push_back(syn); + } + + cout << "waiting for client(s) to finish" << endl; + while (!clients.empty()) { + Client *client = clients.front(); + SyntheticClient *syn = synclients.front(); + clients.pop_front(); + synclients.pop_front(); + + // wait + syn->join_thread(); - // wait - syn->join_thread(); + // unmount + client->unmount(); + client->shutdown(); - // unmount - client->unmount(); - cout << "unmounted" << endl; - client->shutdown(); - - delete client; - + delete syn; + delete client; + } + // wait for messenger to finish rank.wait(); -- 2.39.5