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

Pattern for future conversion

currently we are using asynchronous values very heavily. Assume that I have a function which does something like this: int do_something(const boost::posix_time::time_duration& sleep_time) { BOOST_MESSAGE("Sleeping a bit"); …
duselbaer
  • 935
  • 2
  • 6
  • 10
0
votes
3 answers

multithreaded program producer/consumer [boost]

I'm playing with boost library and C++. I want to create a multithreaded program that contains a producer, conumer, and a stack. The procuder fills the stack, the consumer remove items (int) from the stack. everything work (pop, push, mutex) But…
ezzakrem
  • 399
  • 5
  • 15
0
votes
1 answer

compile boost 1.51.0 on centos6.0 final 64bit

I compiled boost 1.51.0 on centos6.0 final 64bit(g++ 4.4). there is no error while compiling. however, when I'm trying to link libboost_thread.a to my program, there is a linking error saying undefined reference toboost::thread::~thread()'`. I…
0
votes
1 answer

How to thread a callable function who is method of a class

Using MS VC++ 2012 and Boost library 1.51.0 This is a snapshot of my problem: struct B { C* cPtr; } struct C { void callable (int); } void function (B* bPtr, int x) { // error [1] here boost::thread* thrPtr = new…
Old newbie
  • 811
  • 2
  • 11
  • 21
0
votes
3 answers

Linker Issues with boost::thread under linux using Eclipse and CMake

I'm in the process of attempting to port some code across from PC to Ubuntu, and am having some issues due to limited experience developing under linux. We use CMake to generate all our build stuff. Under windows I'm making VS2010 projects, and…
OcularProgrammer
  • 482
  • 2
  • 5
  • 19
0
votes
1 answer

Passing class object as argument to boost::thread

I have a function called "producer" that takes a class object as argument. I am trying to create thread for producer using boost::thread. However it is causing error because of the class object that I am passing as argument. I cannot figure out why…
Haider
  • 938
  • 2
  • 11
  • 25
0
votes
0 answers

boost::shared_future: Read value multiple times

I want to use futures in a multithreaded C++ application. The value associated to a certain promise should be read by more than one thread. I though boost::shared_future is meant to be used for that, but unfortunately I can read the value only…
arngineer
  • 105
  • 1
  • 1
  • 8
0
votes
1 answer

Boost wave - building with MSVC 64 bit

I need a dynamically linkable build of some boost libraries, and wave is one of them. When using the b2.exe command line tool, some libraries won't build (among them is wave). This is what I used for the command line parameters: C:\boost>b2.exe…
teodron
  • 1,410
  • 1
  • 20
  • 41
0
votes
1 answer

c++ boost thread_group with asycron returns

I´m trying to write a function that handles both input arguments and return values from a thread in a thread group. My example class: // includes... class MyClass(int id) { thread_id = id; i = id* 5; b = false; } void resetCounter(int…
user1432032
  • 155
  • 5
  • 14
0
votes
2 answers

How to implement a multi-threaded asynchronous operation?

Here's how my current approach looks like: // Somewhere in a UI class // Called when a button called "Start" clicked MyWindow::OnStartClicked(Event &sender) { _thread = new boost::thread(boost::bind(&MyWindow::WorkToDo,…
Yana D. Nugraha
  • 5,069
  • 10
  • 45
  • 59
0
votes
2 answers

boost interprocess scoped lock with timer blocks despite should return

I have some code of my application that makes usage of boost inteprocess scoped lock with timers. When a mutex is acquired in one thread, a second thread tyring to acquire it for few milliseconds will fail and will log something to screeen. I don't…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173
0
votes
1 answer

Multi thread Writing data in TinyXMl

for TinyXML is a good XMl libuary, i use it to save packet data in network transmission, such as the client receive some packet from the server in UDP muticast mode. client join more than one muticast groups, so it must create multi-thread to…
user909691
  • 25
  • 1
  • 1
  • 8
0
votes
1 answer

Boost signals2 connect() call fails to compile if slot object contains mutex & condition variable

Compiler: MSVS 2008 Boost: 1.49 Code: #include #include class SigOwner { public: typedef boost::signals2::signal OSig; OSig _signal; void doConnect(OSig::slot_type slot) {…
Mike C
  • 1,224
  • 10
  • 26
0
votes
1 answer

Is there a way to have a boost thread per object of a class?

In my code I want to create a bunch of objects of a class and then give each object a separate thread so objects can all carry out actions at the same time as each other. for (i = 0; i < ROBOTCOUNT; i++) { Robot* r = new Robot; boost::thread…
Jigglypuff
  • 1,433
  • 6
  • 24
  • 38
0
votes
1 answer

program with boost thread 1.51 doesn't build

I am trying to compile a program using boost thread with the latest version. I am using gcc version 4.1.2 20080704 (Red Hat 4.1.2-52) With the 1.50 I had an issue saying that the reference to boost::thread::~thrad() couldn't be found. So I updated…
Abruzzo Forte e Gentile
  • 14,423
  • 28
  • 99
  • 173