boost-thread Questions

4

Solved

I am running function Foo from somebody else's library in a single-threaded application currently. Most of the time, I make a call to Foo and it's really quick, some times, I make a call to Foo and...
Mica asked 18/6, 2009 at 22:17

2

This issue has been around for all Visual Studio versions, but in VS 2015 the "old tricks" don't seem to work anymore. This is what I have tried: create a Windows Forms application in VS 2...
Tiemroth asked 17/10, 2016 at 8:12

2

Solved

Stack Overflow has several examples where a function obtains an upgradeable lock first and then obtains exclusive access by upgrading. My understanding is that this can cause deadlocks if not used ...
Ruben asked 4/11, 2013 at 16:20

4

Solved

When this floating point calculation is executed in boost::thread, it gives different result than when executed in std::thread or in main thread. void print_number() { double a = 5.66; double b ...
Meuser asked 14/7, 2016 at 10:17

5

Solved

I started to use the unordered_set class from the tr1 namespace to speed-up access against the plain (tree-based) STL map. However, I wanted to store references to threads ID in boost (boost::threa...
Waw asked 21/4, 2009 at 11:49

4

I am trying to compile my program but it wouldn't link at all. I have specified the path to the boost lib files and the linker still complain. Here's the linking error I got: 1>Edproj.obj : err...

3

Solved

I have an application that needs to do work within certain windows (in this case, the windows are all 30 seconds apart). When the time is not within a window, the time until the middle of the next ...
Felodese asked 21/5, 2015 at 18:41

1

Solved

Looking at answers like this one, we can do stuff like: boost::asio::io_service ioService; boost::thread_group threadpool; { boost::asio::io_service::work work(ioService); threadpool.create_thre...
Denti asked 16/12, 2015 at 5:4

2

I'm trying to use Boost.Thread on Windows using clang++. While including boost/thread.hpp, I'm getting the following compile errors: Using -DBOOST_USE_WINDOWS_H: In file included from D:/env/boo...
Gladwin asked 2/5, 2015 at 14:43

3

Solved

I'm trying to learn something with boost libraries, but I get a problem when I try to compile something that includes boost::threads. I get an error during linking, this is the message: /usr/lib/g...
Haha asked 5/3, 2012 at 19:25

4

Solved

And would it be a good idea to do so if I needed the processor cores running on 100% for a dozen seconds or would I get better performance if I let the system decide how to handle the threads? Wha...
Sergo asked 11/11, 2012 at 21:29

1

Solved

I am running the following chunk of the code. This code is going to create 5 slave threads and 1 main thread. All slave threads are waited for the main thread to make the data ready and when the da...
Tailgate asked 1/7, 2015 at 14:51

1

I'm trying to compile a Boost library into a universal binary file (i.e. a "fat" file that contains builds for both the i386 and x86_64 architectures). Souring the internet and SO I assembled the ...

3

Solved

I am very confused about the difference between a lock and mutex. In Boost docs, it says, Lock Types Class template lock_guard Class template unique_lock Class template shared_lock Class templa...
Correna asked 21/2, 2012 at 17:24

3

Solved

thread_ = boost::thread( boost::function< void (void)>( boost::bind( &clientTCP::run , this ) ) ); is it possible that run has an argument like this : void clientTCP::run(boost:functi...
Koller asked 20/4, 2011 at 13:1

3

Solved

I noticed that boost does not seem to support semaphores. What's the easiest way to achieve a similar effect?
Iridescence asked 13/10, 2010 at 23:24

8

Solved

So I'm writing this neat little program to teach myself threading, I'm using boost::thread and C++ to do so. I need the main thread to communicate with the worker thread, and to do so I have been ...
Feaster asked 18/2, 2015 at 18:40

1

In a class, I want to use a mutex over a function like this void Agent::notify(Packet& packet, Peer peer) { boost::mutex::scoped_lock lock(mutex_); ... } No problem at the compilation pro...
Allerie asked 26/12, 2014 at 18:21

1

Solved

The boost library (before the C++11 standard), offered support for threads. As part of its support, it also offers the implementation of a "barrier", a simple class which allows synchronization. To...
Irresoluble asked 4/10, 2014 at 7:56

1

Solved

This question should be a little simpler than my last few. I've implemented the following work queue in my program: Pool.h: // tpool class // It's always closed. :glasses: #ifndef __POOL_H #defin...
Admirable asked 19/9, 2014 at 2:6

1

I need to set up a producer-consumer scheme with two threads linked by a queue (the producer pushing tasks into the queue, the consumer executing them as they come). Since the queue will be empty ...
Spark asked 22/8, 2014 at 22:28

2

I want to terminate or kill boost thread. code is here: DWORD WINAPI StartFaceDetector(LPVOID temp) { int j=0; char **argv1; QApplication a(j,argv1);//add some thread here gui::VisualControl...
Reubenreuchlin asked 9/5, 2014 at 7:26

3

Solved

A question about threads in C/C++... C++0x syntax #include <thread> void dummy() {} int main(int, char*[]) { std::thread x(dummy); std::thread y(dummy); ... return 0; } How many thr...
Moureaux asked 19/8, 2009 at 15:34

2

Solved

Is it thread safe to post new handlers from within a handler? I.e. Can threads that called the io_service::run() post new Handlers to the same io_service? Thanks
Rodmun asked 16/6, 2011 at 8:50

1

Solved

I wanted to try boost future then, I have boost 1.55 installed and included in make file and I wanted to try official demo #define BOOST_THREAD_PROVIDES_FUTURE #include <boost/thread/future.hp...
Solander asked 30/4, 2014 at 2:23

© 2022 - 2024 — McMap. All rights reserved.