From edb81bac8370bb09ddc9ff7a85fafb852a8e05ba Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Tue, 24 Jun 2014 18:44:15 -0400 Subject: [PATCH] stack-size portfolio fix. boost 1.50 now required --- src/main/portfolio.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/portfolio.cpp b/src/main/portfolio.cpp index ebf36b0cd..b6b2ac348 100644 --- a/src/main/portfolio.cpp +++ b/src/main/portfolio.cpp @@ -72,9 +72,21 @@ std::pair 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, t, threadFns[t], + boost::thread(attrs, boost::bind(runThread, 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()) -- 2.30.2