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
-1
votes
1 answer

Fastest method for Brute Force?

I'm trying to brute force a ZIP file for a school project and realized that's very slow (about 1600 Tries/Sec). Is it any method that allows to run multiples tries at the same time or split the whole process without slowing it down? I heard about…
-1
votes
2 answers

Make a safe Reader/Writer vector

Inspired by this code, I am trying to implement a Reader/Writer vector that can safely call push_back() concurrently by threads. Once this class is in place, I might then create method erase() by calling std::swap(), which swaps the target item and…
Masao Liu
  • 749
  • 2
  • 7
  • 16
-1
votes
2 answers

Randomly endless thread and various bugs, while parallel line-by-line reading/writing

I want to implement a parallel reading-processing-writing line by line based on boost::thread, but the current version has indefinite behaviour : the following test reads a CSV file by filling the read (concurrent) queue, which is simply transferred…
Mister Mystère
  • 952
  • 2
  • 16
  • 39
-1
votes
1 answer

boost does not accept anonymous functions as input for anything

The following code piece does not compile for me: #include #include int main(int argc, char* argv[]) { boost::thread thread( []() { std::cout<<"hello"; } …
-1
votes
3 answers

How to interrupt boost::this_thread in c++

In my application i have given sleep of 10 sec. I have given sleep using boost::this_thread::sleep function. Is there any possible way to interrupt boost::this_thread::sleep function.?
Mukul
  • 114
  • 1
  • 11
-1
votes
1 answer

C++ thread connect in Qt

I am starting to learn threads in the C++11 standard in Qt.I can't include library ,no such of directory For example, I have the following simple code: #include #include #include using namespace std; void…
-1
votes
1 answer

share_ptr of boost::thread assertion fail

class WIFITest { public: void StartTest(); void Notify_Test(boost::shared_ptr basic_msg, ID id ); private: void OpenStaMode_test(); private: boost::shared_ptr OpenStaMode_testThread; …
UNSTABLE
  • 393
  • 1
  • 4
  • 13
-1
votes
1 answer

Execute a sequence of instructions without switching to another thread

I have written a MultiThread C++ Codes using boost. I have the below code in my main thread: while (!mInputQueue.empty() && mStartProcessJobs) mProcessJobs.wait(lock); the second line should be executed immediately after the first line and…
Smn
  • 71
  • 2
  • 10
-1
votes
1 answer

increasing efficiency of following code using threads

I'm using a machine having 8 cores and 32GB ram. In this machine, I'm running a code in c++ using VS2010 on Windows x64 which takes 3 days to complete 8 trees(8 is the number of outer threads). I searched for bottleneck and find out that…
smttsp
  • 4,011
  • 3
  • 33
  • 62
-1
votes
1 answer

Multithreaded Game Loop Rendering/Updating (boost-asio)

So I have a single-threaded game engine class, which has separate functions for input, update and rendering, and I've just started learning to use the wonderful boost library (asio and thread components). And I was thinking of separating my update…
-1
votes
1 answer

Is performance affected if multiple threads use the same object?

The object in this case is a dictionary with some search methods. Only reading operations.
Kesarion
  • 2,808
  • 5
  • 31
  • 52
-1
votes
1 answer

tree sum threaded c++

I have a tree with numbers and a boolean to see if the numbers have been summed this is the code: #include #include #include #include using namespace std; class ThreadBase { private: …
Pedro.Alonso
  • 1,007
  • 3
  • 20
  • 41
-2
votes
1 answer

using Boost Thread for running a function on multiple threads with different input

Suppose I have a function which returns a map like: std::map functionname(string abc123) How can I pass different string to same function in separate threads using boost thread??(value returned is stored in different…
psyche
  • 443
  • 1
  • 5
  • 14
-2
votes
1 answer

trouble with boost error lock

I can't figure out where is the problem with this simple code, I think that here is the trouble with output to Console maybe deadlock or something, can somebody, please help. #include #include #include #include…
overwriter
  • 339
  • 3
  • 14
-3
votes
2 answers

Boost Thread int parameter to member function not working?

Completely new to threading and concurrency but I'm trying to start a function as a new thread and I don't understand my errors. I receive an error along the lines of Candidate expects X arguments, 2 provided. This error repeats for 0 < X <= 9…
whitfin
  • 4,539
  • 6
  • 39
  • 67
1 2 3
58
59