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

Pantheios and boost::thread

I am having some trouble using the pantheios logging library with boost::threads. It seems that if I use any pantheios logging before creating the thread, I will get a segfault. For example, the following would work: thread_ = new…
Andrew Lee
  • 2,543
  • 3
  • 20
  • 31
0
votes
1 answer

boost thread link fails in Netbeans 7.1 debugging/testing session

I am developing an app on Netbeans, while I can run it. I can not debug or reun the test files. When I try to do so, I get: ./build/Debug/GNU-Linux-x86/tests/TestFiles/f1: error while loading shared libraries: libboost_thread.so.1.49.0: cannot open…
Potney Switters
  • 2,902
  • 4
  • 33
  • 51
0
votes
1 answer

Boost async_read_some not exactly asynchronous

This is my server code: socket_.async_read_some(boost::asio::buffer(data_read.data(), Message::header_length), boost::bind(&TcpConnection::handle_read_header, shared_from_this(), boost::asio::placeholders::error)); If i write a the the…
Navin
  • 554
  • 2
  • 9
  • 31
0
votes
1 answer

Boost thread does no sleep properly, Am I missing something?

Consider following example, On windows 7 icore7 laptop(VC++2010) and ubuntu 64bit 12.04 lte gcc 4.6.3 #include #include #include typedef boost::posix_time::ptime…
Arman
  • 4,566
  • 10
  • 45
  • 66
0
votes
1 answer

Build boost.thread - lib file not found

I am trying to build the boost.thread library for Visual Studio 9.0. I used bjam to build the lib-files: bjam toolset=msvc-9.0 variant=release threading=multi link=shared The compilation succeeded and I got plenty of .lib and .dll files under…
mbue
  • 1,591
  • 2
  • 14
  • 34
0
votes
3 answers

Accessing The Callable Object a boost::thread Was Constructed With

I am using Boost 1.49 and MSVC10. If a boost::thread is constructed with a callable object1, and that object has member functions or variables I want to access from outside the context of the thread, how do I get to the callabe object? For example,…
John Dibling
  • 99,718
  • 31
  • 186
  • 324
0
votes
1 answer

how to compile boost_thread for android NDK?

I have a neeed to create threads and I am preferring to use boost threads! Firstly is this possible for android-ndk ? If so, then I started to include boost_thread sources in my project. I referred some stackoverflow posts where I found the need to…
madan kandula
  • 460
  • 5
  • 22
0
votes
0 answers

Exception when calling a function on the boost::barrier object from another library

I've a C++ application which loads a DLL and passes a callback. The DLL creates its own thread, does some tasks and passes a pointer to boost::barrier object to the main application through the callback. But when I call wait() on the barrier object,…
0
votes
2 answers

boost threads in c++

So I'm modifying a code to be multithreaded, I have read several articles but have not found my answer, I have the Main, Class A, Class B, now I want to know if it's possible to program threads in class b so when when main calls class a this in turn…
Pedro.Alonso
  • 1,007
  • 3
  • 20
  • 41
0
votes
1 answer

Ignore a previous version of boost C++

I have to give a demo on a machine which contains an old version of the C++ boost library. Specifically I need boost::thread, in which I am using the lock member function of the mutex class. Unfortunately the old version (1.33.1) does not contain…
machine yearning
  • 9,889
  • 5
  • 38
  • 51
-1
votes
1 answer

Boost thread_group blocks when calling add_thread from thread, why?

I've written a multithreaded program similar to the following structure (I've omitted the mutex and extraneous code), and it blocks on the call to boost::thread_group.add_thread() when called from a thread. Is there any way around this, so the call…
nickb
  • 59,313
  • 13
  • 108
  • 143
-1
votes
1 answer

program crash using boost::asio

I am trying to download file using asio . the program is multithreaded and system is ubuntu with gcc 7.5 in the following function: void HTTPRequest::ReadStatusLine(boost::asio::yield_context yield_r) { boost::unique_lock
ahmed allam
  • 377
  • 2
  • 15
-1
votes
3 answers

boost::thread not updating global variable

I am using a wrapper function in an external software to start a new thread, which updates a global variable, but yet this seems invisible to the main thread. I cant call join(), not to block the main thread and crash the software. boost::async,…
Don I
  • 91
  • 10
-1
votes
1 answer

Threads and Signals

I have a C++98 project that uses Boost-Thread. The main thread creates 12 threads like this: for(int i=0;i
Geom
  • 827
  • 4
  • 15
-1
votes
1 answer

C++ Thread blocks Main-Thread

Problem: When the ExecuteQueue Function get's called there's already two existing Packets in Queue and they get called correctly (printed to console). But even though the ExecuteQueue Function get's looped in another Thread the Main Thread is…
Swagov3rflow
  • 25
  • 1
  • 8
1 2 3
58
59