boost-thread Questions

4

Solved

Consider, say, a collection of account balances. And then you have a complex function that needs to check the balances of a few different accounts and then adjust the balances of a few different ac...
Huckaback asked 11/11, 2011 at 4:31

4

I have a total n00b question here on synchronization. I have a 'writer' thread which assigns a different value 'p' to a promise at each iteration. I need 'reader' threads which wait for shared_futu...
Diaconal asked 30/6, 2011 at 21:34

3

Solved

Is there anything like boost::thread_group in C++11? I'm just trying to port my program from using boost:thread to C++11 threads and wasn't able to find anything equivalent.
Slacken asked 27/3, 2012 at 17:5

4

Solved

How do I create a thread pool using boost in C++, and how do I assign tasks to the threadpool?
Leaden asked 21/10, 2013 at 16:55

6

I want to delegate a time-consuming process to a separate thread in my C++ program. Using the boost libraries, I have written code something like this: thrd = new boost::thread(boost::bind(&myc...
Dafodil asked 29/8, 2008 at 8:2

4

Solved

Is it possible to perform an asynchronous wait (read : non-blocking) on a conditional variable in boost::asio ? if it isn't directly supported any hints on implementing it would be appreciated. I ...

12

Solved

Is it true that C++0x will come without semaphores? There are already some questions on Stack Overflow regarding the use of semaphores. I use them (posix semaphores) all the time to let a thread wa...
Diorama asked 25/1, 2011 at 10:38

3

Solved

Is it possible to give a name to a boost::thread so that the debuggers tables and the crash logs can be more readable? How?
Antacid asked 27/7, 2010 at 9:14

7

#include <boost/thread/thread.hpp> #include <iostream> void hello() { std::cout << "Hello world, I'm a thread!" << std::endl; } int main(int argc, char* argv[]) { boos...
Spitball asked 27/8, 2010 at 13:1

2

Solved

What are the tradeoffs b/w boost::thread, std::thread (C++11), and pthread for high CPU throughput (read: lots of floating point operations) Linux based applications? When should one implementation...
Soot asked 2/9, 2020 at 11:56

3

A simple program is: I would like to get the thread ID of both of the threads using this gettid function. I do not want to do the sysCall directly. I want to use this function. #include <iostr...
Lannylanolin asked 6/6, 2015 at 8:15

1

I am updating a code that previously uses its own read and write lock mechanism (this code was written prior to C++11 and std::shared_mutex does not exist yet) to use the std version of C++. There...
Coston asked 13/1, 2020 at 4:43

3

Solved

Ubuntu 19 running inside Docker GCC 8.3 Boost 1.69 Valgrind 3.14.0 When the application is shutting down Valgrind reports these 3 issues: ==70== Mismatched free() / delete / delete [] ==70== at...
Cavanaugh asked 26/9, 2019 at 6:46

1

I'm trying to create producer/consumer using Boost.Fibers. Looks like using channels from this example is the right thing to do. The example have to be changed slightly since I want to signal compl...
Elsewhere asked 15/4, 2018 at 8:3

3

Solved

I have the following code: #include <string> #include <boost/thread/tss.hpp> static boost::thread_specific_ptr<string> _tssThreadNameSptr; I get the following error g++ -c -I$B...
Labrum asked 1/9, 2012 at 18:11

3

Solved

I have a fairly complex multi threaded application (server) that from time to time will crash due to an assert: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr< <templa...
Potentiality asked 22/8, 2010 at 10:48

4

Solved

Usage: In our production we have around 100 thread which can access the cache we are trying to implement. If cache is missed then information will be fetched from the database and cache will be upd...
Audra asked 31/1, 2018 at 4:7

2

Solved

At work we have an MFC Extension DLL that built fine with 1.35 but when built with 1.43 causes the following error: error LNK2005: __pRawDllMain already defined in ApObs.obj If I activate BOOST_...
Huelva asked 12/8, 2010 at 11:7

5

Solved

I am trying to learn how to use the C++ Boost.Thread library. I have installed the Boost libraries on my Ubuntu 11.10 system. I am following the book "The Boost C++ Libraries" by Schaling - specifi...
Orizaba asked 28/10, 2011 at 19:55

4

Solved

This is the code to create a thread_group and execute all threads in parallel: boost::thread_group group; for (int i = 0; i < 15; ++i) group.create_thread(aFunctionToExecute); group.join_all()...
Offwhite asked 27/7, 2010 at 13:20

3

How do I handle the control-C event or stop my boost::asio server. I have a tcp & udp combined server and would like to be able to exit cleanly when I press ctrl-c. I get a first chance excepti...
Barrio asked 15/6, 2011 at 21:34

1

Solved

I have a requirement of executing a callback function on exit of a std::thread and the callback function should be executed on the main thread. On thread creation I need to detach the thread and c...
Russell asked 26/7, 2017 at 17:36

1

Solved

I am using PortAudio to implement a real-time audio processing. My primary task is to acquire data from mic continuously and provide 100 samples for processing (each FRAME = 100 samples at a time...
Buckeen asked 20/6, 2017 at 6:32

2

Solved

So i'm using a boost::lockfree::spec_queue to communicate via two boost_threads running functors of two objects in my application. All is fine except for the fact that the spec_queue::pop() method...
Cyma asked 18/3, 2014 at 17:21

2

I have an os and compile with no -mthread avaliable. Thow I have -pthread. How to compile boost_thread with -pthread instead of -mthread? My current compiler build log: ./b2 -j1 --with-thread lin...
Agar asked 19/10, 2012 at 23:26

© 2022 - 2024 — McMap. All rights reserved.