Questions tagged [boost-thread]

Boost.Thread enables the use of multiple threads of execution with shared data in portable C++ code.

Boost.Thread enables the use of multiple threads of execution with shared data in portable C++ code. It provides classes and functions for managing the threads themselves, along with others for synchronizing data between the threads or providing separate copies of data specific to individual threads.

The Boost.Thread library was originally written and designed by William E. Kempf. For Boost 1.35+, Anthony Williams performed a major rewrite designed to closely follow the proposals presented to the C++ Standards Committee, in particular N2497, N2320, N2184, N2139, and N2094.

As of Boost version 1.50.0 Boost.Thread provides an almost complete implementation of the C++ 2011 Threads library, plus extensions such as shared locks and thread interruption.

885 questions
0
votes
2 answers

Boost threads not making program faster

I have coded a JPG decoder as such for each dataunit{ decode transform write to rgb buffer } Then I coded it with boost threads as such for each dataunit{ decode } for each dataunit{ transform } for each dataunit{ write to rgb…
deanresin
  • 1,466
  • 2
  • 16
  • 31
0
votes
1 answer

How to use boost::asio::io_service to dispatch jobs between C++11 threads

I need to perform on a multi-core architecture a huge quantity of relatively short tasks. For this I wanted to use a fixed size thread pool and some reliable implementation of an executor. I was reading about boost::asio and io_service in this post…
Federico Bonelli
  • 761
  • 1
  • 7
  • 23
0
votes
0 answers

Boost 1.49 Condition Variable issue

I am trying to use Boost Conditional variable in my application to synchronize two different threads as following: The main thread, will create a TCP server and instance of object called MIH-User and register a callback to an…
IoT
  • 607
  • 1
  • 11
  • 23
0
votes
0 answers

Boost Threading : Mutex with Conditional Variable ,main thread hanging

I am trying to implement a state machine as a part of a class called" Source Transaction". Evey-time I receive a request in the main thread, it generates an instance of this class and the state machine starts executing until it reaches a state…
IoT
  • 607
  • 1
  • 11
  • 23
0
votes
0 answers

Boost thread v1.53 segmentation fault

The following program produces a segmentation fault, although I don't see any undefined behaviour in the code. It has been compiled with GCC 4.7.3. Do you know the reason of the fault or a possible work-around? Also, it seems boost::future does not…
Martin
  • 9,089
  • 11
  • 52
  • 87
0
votes
0 answers

Compiling Boost Blocking TCP Echo Client

I am trying to compile The example of Blocking TCP echo client: using the Boost.build b2 command as following: b2 linkflags=-lpthread toolset=gcc threading=multi link=static But I am getting the following errors: gcc.link…
IoT
  • 607
  • 1
  • 11
  • 23
0
votes
0 answers

why my compiled boost thread not support boost::thread?

I tried to compile 1.55 boost libraries using Ubuntu 12.04. The compiled boost libraries does not allow me to use boost::thread or boost::mutex. When I look inside the boost/thread/mutex.hpp, the preprocessor fall into: #error "Boost threads…
Sany Liew
  • 1,615
  • 21
  • 25
0
votes
1 answer

How can I make JNI RegisterNatives callack Java functions have C++ instance scope?

I have a C++ application that triggers an Akka Actor-based MapReduce system. This I do via a C++ JNI wrapper class MapReduceBridge and it works fine taking into account that the Akka Actor and the C++ application threads need to synchronize (shown…
SkyWalker
  • 13,729
  • 18
  • 91
  • 187
0
votes
0 answers

Boost thread finally block handling

I am porting C++ library from Windows to Linux. This is multi-threaded library. In Windows version there are __try/__finally block used for freeing resources and other activity after thread end. GCC doesn't support __try/__finally and C++ standard…
exbluesbreaker
  • 2,160
  • 3
  • 18
  • 30
0
votes
1 answer

Log4cxx is slow when used without critical section

I am doing performance testing on log4cxx. When I call LOG4CXX_XXXXX directly the following code takes around 10 secs to finish logging everything. But when I enclose the call with boost::lockguard (which I think is a critical section) it takes…
brar
  • 13
  • 4
0
votes
3 answers

My multithreaded game is at 100% CPU all the time. How can I manage thread activity to reduce the CPU load?

I have a DirectX game which spawns 2 boost threads on a dual-core system: 1 for gameplay/rendering (normally split into their own threads on a quad-core CPU), and 1 other thread which procedurally-generates the gameworld. I believe that my audio…
Raptormeat
  • 312
  • 2
  • 14
0
votes
1 answer

access to shared_ptr in boost dispatcher

I use a boost dispatcher (io_service) to execute asynchronously "methodB". Into this method, I would like to keep a pointer to the instance of the class B, so I use shared_ptr. But in the below example, I wonder whether after the scope of "methodA",…
user1886318
  • 235
  • 3
  • 11
0
votes
2 answers

Boost threads coring on startup

I have a program that brings up and tears down multiple threads throughout its life. Everything works great for awhile, but eventually, I get the following core dump stack trace. #0 0x009887a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2 #1 …
Craig H
  • 7,949
  • 16
  • 49
  • 61
0
votes
1 answer

Many detached boost threads segfault

I'm creating boost threads inside a function with while(trueNonceQueue.empty() && block.nNonce < std::numeric_limits::max()){ if ( block.nNonce % 100000 == 0 ) { cout << block.nNonce << endl; } boost::thread…
user1382306
0
votes
1 answer

Undefined symbols for architecture x86_64 - in libboost_thread-mt.a

boost::atomics::detail::lockpool::get_lock_for(void const volatile*)", referenced from: boost::thread_detail::enter_once_region(boost::once_flag&) in libboost_thread-mt.a(once.o) boost::thread_detail::commit_once_region(boost::once_flag&) in…