stack-size portfolio fix. boost 1.50 now required
authorMorgan Deters <mdeters@cs.nyu.edu>
Tue, 24 Jun 2014 22:44:15 +0000 (18:44 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Tue, 24 Jun 2014 23:22:42 +0000 (19:22 -0400)
src/main/portfolio.cpp

index ebf36b0cdc1ef0bf48b1376dd98a6814a7fee09c..b6b2ac34812fb08f2c8dd1fbb4f975019513fd42 100644 (file)
@@ -72,9 +72,21 @@ std::pair<int, S> runPortfolio(int numThreads,
   global_winner = -1;
 
   for(int t = 0; t < numThreads; ++t) {
+
+    boost::thread::attributes attrs;
+    attrs.set_stack_size(256 * 1024 * 1024);
+
     threads[t] = 
-      boost::thread(boost::bind(runThread<S>, t, threadFns[t],
+      boost::thread(attrs, boost::bind(runThread<S>, t, threadFns[t],
                                 boost::ref(threads_returnValue[t]) ) );
+  /*
+    void *stackaddr;
+    size_t stacksize;
+    pthread_attr_t attr;
+    pthread_getattr_np(threads[t].native_handle(), &attr);
+    pthread_attr_getstack(&attr, &stackaddr, &stacksize);
+    std::cerr << "I am " << t << " with stack size " << stacksize << std::endl;
+   */
   }
 
   if(not driverFn.empty())