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
4 answers

C++ threaded class design from non-threaded class

I'm working on a library doing audio encoding/decoding. The encoder shall be able to use multiple cores (i.e. multiple threads, using boost library), if available. What i have right now is a class that performs all encoding-relevant operations. The…
Sebastian
  • 8,046
  • 2
  • 34
  • 58
0
votes
0 answers

Use of boost:mutex crashes plugin when on Windows 8

I am developing a cross-platform, cross browser NPAPI plugin based on Firebreath framework. I am using boost library 1.46.1 and boost::mutex in order to synchronize boost threads used in the program. The code compiles and runs as expected in Ubuntu…
KoKa
  • 797
  • 1
  • 14
  • 31
0
votes
2 answers

simple server thread for receiving file from a local PC - file temporarily empty

(I'm not a pro) I'd like some tip on what is going wrong in my code. The connexion is always with the same computer once the first file is received. Just after receiving the file I want to open it to modify some variable in my main program. But the…
user3544665
  • 55
  • 10
0
votes
1 answer

boost async_wait() will cause a new thread?

We have a method that needs to be called frequently to do some computations (about 20 times per second). It is a synchronized call. The caller needs to get the result as soon as possible. But that computation process takes longer than expected…
5YrsLaterDBA
  • 33,370
  • 43
  • 136
  • 210
0
votes
1 answer

Multi-Threaded MPI Process Suddenly Terminating

I'm writing an MPI program (Visual Studio 2k8 + MSMPI) that uses Boost::thread to spawn two threads per MPI process, and have run into a problem I'm having trouble tracking down. When I run the program with: mpiexec -n 2 program.exe, one of the…
bhilburn
  • 579
  • 7
  • 18
0
votes
1 answer

How to correctly use boost::timed_mutex and scoped_lock

I am trying to use both timed_mutex with the scoped_lock. I have successfully used the scoped_lock before by following some examples but now I don't seem to find my way around neither I am able to properly understand the boost documentation. The…
0
votes
1 answer

Is there a way to use boost threads and asio in native-client?

I'm trying to port some existing code that uses boost into native-client. I compiled boost according to the instructions here: https://code.google.com/p/naclports/wiki/InstallingSDL (with boost instead of sdl), and tried injecting some boost code…
0
votes
0 answers

Getting ‘_internal_get_deleter’ missing error in Boost library

I successfully build boost_1_45_0 using source code in Ubuntu but when i am using BOOST to build another package: Scanning dependencies of target GraphMolWrap [ 98%] Building CXX object …
Amit Pal
  • 10,604
  • 26
  • 80
  • 160
0
votes
1 answer

C++ Boost: call function from parent thread

I'm trying to make a thread to callback a function of the object that created the thread. But it seems it is not posible to pass "this" as a parameter. Is there a way to implement this? Thanks in advance. Helper.cpp void…
0
votes
1 answer

Error in linking boost

I am new to boost threads and am trying to compile a simple example I found: #include #include #include void workerFunc() { boost::posix_time::seconds workTime(3); …
fc67
  • 409
  • 5
  • 17
0
votes
1 answer

boost mutex in parallel quicksort

This is my first time using mutexes so I am not exactly sure about what I am doing but I think I am having an error with the thread safety of the push_back function using the vector container (I am having multiple threads write to it at the same…
Dan
  • 2,647
  • 2
  • 27
  • 37
0
votes
1 answer

No matching function for call Error using boost::bind

I am trying to write a parallel bubblesort function. I am running into an error when using boost::bind: void swap(vector& input, int i, int j) { if (input[i] > input[j]) { int temp = input[j]; input[j] = input[i]; …
Dan
  • 2,647
  • 2
  • 27
  • 37
0
votes
0 answers

Quicksort function using Boost threads

I am having a problem with writing a parallel quicksort using the boost threads library. I have narrowed it down to one snippet of code, this code works but is serial: void local_quicksort(vector& input) { //Divide vector into equal sized…
Dan
  • 2,647
  • 2
  • 27
  • 37
0
votes
2 answers

How do I know which thread called a method

I have a threadSafe method that gets called by multiple threads. Is there a way to know which thread called it?
yan bellavance
  • 4,710
  • 20
  • 62
  • 93
0
votes
1 answer

ReadWrite lock using Boost.Threads (how to convert this simple class)

I am porting some code from windows to Linux (Ubuntu 9.10). I have a simple class (please see below), which uses windows functions to implement simple mutex locking. I want to use Boost.Threads to reimplement this, but that library is new to me. Can…
Stick it to THE MAN
  • 5,621
  • 17
  • 77
  • 93