Catalli's threaded switch
[sliver-openvswitch.git] / utilities / ovs-openflowd.c
index 8cb50e4..5d780e1 100644 (file)
@@ -152,18 +152,30 @@ main(int argc, char *argv[])
 
     daemonize_complete();
 
+#ifdef THREADED
+    /* Data thread started */
+    fprintf(stdout, "THREADED version running!\n");
+    dp_start();
+#endif
+
+    /* The following loop polls on protocol messages 
+     * and on messages related to topology changes */
     while (ofproto_is_alive(ofproto)) {
         error = ofproto_run(ofproto);
         if (error) {
             ovs_fatal(error, "unrecoverable datapath error");
         }
         unixctl_server_run(unixctl);
+#ifndef THREADED
         dp_run();
+#endif
         netdev_run();
 
         ofproto_wait(ofproto);
         unixctl_server_wait(unixctl);
+#ifndef THREADED
         dp_wait();
+#endif
         netdev_wait();
         poll_block();
     }