Browse Source

Silicon: Use MAX_THREADS threads for the epoll test.

Matthieu Garrigues 10 years ago
parent
commit
90f6f87823

+ 3 - 3
frameworks/C++/silicon/main.cc

@@ -42,9 +42,9 @@ std::string escape_html_entities(const std::string& data)
 int main(int argc, char* argv[])
 int main(int argc, char* argv[])
 {
 {
 
 
-  if (argc != 3)
+  if (argc != 4)
   {
   {
-    std::cerr << "Usage: " << argv[0] << " mysql_host port" << std::endl;
+    std::cerr << "Usage: " << argv[0] << " mysql_host port nthreads" << std::endl;
     return 1;
     return 1;
   }
   }
   
   
@@ -120,7 +120,7 @@ int main(int argc, char* argv[])
     // Start the server.
     // Start the server.
     sl::mhd_json_serve(hello_api, atoi(argv[2])
     sl::mhd_json_serve(hello_api, atoi(argv[2])
 #ifdef TFB_USE_EPOLL
 #ifdef TFB_USE_EPOLL
-                       , _linux_epoll, _nthreads = 1000
+                       , _linux_epoll, _nthreads = atoi(argv[3])
 #else
 #else
                        , _one_thread_per_connection
                        , _one_thread_per_connection
 #endif
 #endif

+ 1 - 1
frameworks/C++/silicon/setup_epoll_mysql.sh

@@ -1,3 +1,3 @@
 #! /bin/bash
 #! /bin/bash
 
 
-$TROOT/build/silicon_epoll_mysql ${DBHOST} 8080 &
+$TROOT/build/silicon_epoll_mysql ${DBHOST} 8080 ${MAX_THREADS} &

+ 1 - 1
frameworks/C++/silicon/setup_tpc_mysql.sh

@@ -1,3 +1,3 @@
 #! /bin/bash
 #! /bin/bash
 
 
-$TROOT/build/silicon_tpc_mysql ${DBHOST} 8080 &
+$TROOT/build/silicon_tpc_mysql ${DBHOST} 8080 ${MAX_THREADS} &