Tagged Questions
0
votes
0answers
21 views
Error in building boost library for Android framework on Linux
I am facing a problem while building boost library from latest version 1.53.0.
While following all steps as described in most of the tutorials for building boost library on Linux system for Android ...
1
vote
1answer
53 views
boost c++ libraries: sleep_for wait (almost) twice
I'm using the Boost C++ Libraries but I've some problems with `sleep_for` function: it takes very long time!!! If I want to sleep a thread for just 1 second it sleep the thread for 2 seconds!!!
I'm ...
0
votes
0answers
63 views
Excessive Kernel Launches on Context Creation
Recently I began extending a very boost dependent project to use CUDA for its innermost loop. I thought it would be worth posting here about some odd behaviour I've been seeing though. Simply ...
0
votes
1answer
49 views
Boost Async Threading
So I have been using boost as a solution for threading.
I seem to be having an issue where the threads I create dont let the main thread that was executing them continue.
Eg:
int main(){
...
0
votes
0answers
91 views
c++ -std=c++11 -stdlib=libc++ with boost.thread gives Segmentation fault: 11 on OSX
Tried to run some sample code.
But something unexpected occured.
I wonder is there any known issus about boost.thread used with libc++ together ?
Program compiled with -std=c++11 or no option runs ...
1
vote
1answer
49 views
Boost: Threading and mutexes in a functor
I'm trying something simple with threads and mutexes in C++ with boost.
This is the code:
#include <iostream>
#include <boost/thread/thread.hpp>
class mutex_test
{
private:
...
0
votes
1answer
52 views
Difference between Boost and Pthread condition variables
I found some code using boost threads, mutexes and condition variables but I wanna try to rewrite this code with posix threads.
This is the Boost code, I´ve found here:
void push(Data const& ...
1
vote
2answers
58 views
Building Boost.Thread without interruption
How can I build boost.thread without default interruption point. I think that my application crash in a predefined interruption points. I'm using boost 1.53.0 with msvc10
I've the following code
...
0
votes
1answer
41 views
notify_all causes segmentation fault
I am using boost threads, upon calling notify_all() within the destructor i am seeing a segmentation fault. Here is the stack:
(gdb) where
#0 0x00007ffff752de84 in pthread_mutex_lock ()
from ...
3
votes
1answer
49 views
Struggling to get boost shared memory segments to construct
I have some code with which I'm trying to make a shared memory segment. This segment is managed, on this end, from within a class. The shared segment will be used in a "bulletin board" fashion. ...
3
votes
1answer
83 views
Different behavior of boost::condition_variable under VC++ and GCC
On my computer, running on Windows 7, the following code, compiled in Visual C++ 2010 with Boost 1.53, outputs
no timeout
elapsed time (ms): 1000
The same code compiled with GCC 4.8 (online link) ...
0
votes
1answer
52 views
boost::condition_variable with boost::mutex::scoped_lock
Initially I was using boost::mutex::scoped_lock as such (which worked)
boost::mutex::scoped_lock lock(mutex_name);
condition.wait(lock); //where condition = boost::condition_variable
However later ...
1
vote
1answer
127 views
C++ linker error using Boost Thread
Attempting to build a standard Boost::thread example I found on the internet, I get multiple errors thrown by the Boost header file thread_data.hpp, which I don't link to directly but which I presume ...
2
votes
2answers
108 views
Interrupting threads if not joined
I am looking for a way(preferably with boost threads), to interrupt a thread if it has not joined. I start multiple threads, and would like to end any of them that have not finished by 200 ...
5
votes
1answer
96 views
Communication b/w two threads over a common datastructure. Design Issue
I currently have two threads a producer and a consumer. The producer is a static methods that inserts data in a Deque type static container and informs the consumer through boost::condition_variable ...
0
votes
1answer
82 views
Cannot use boost::threads in Visual Studio 2012
I get the following error using boost::threads in visual studio 2012 (CTP Nov 2012). I'm using boost 1.53.
1>boost/config/requires_threads.hpp(29): fatal error C1189: #error : "Threading support ...
2
votes
1answer
142 views
Is there a bug in the boost asio HTTP Server 3 example or boost bug?
boost library version 1.53
Debian Linux 6.0 ( Linux 2.6.32-5-amd64 on x86_64 )
It is hard to test own software when valgrind log contains lots of warnings.
So with no changes I built the HTTP server3 ...
0
votes
1answer
95 views
How to check boost thread is running and Kill it
In my program, it start a boost thread and keep the handler as a member of the main thread.
When user press the cancel button I need to check the started thread still running and if it is running ...
0
votes
1answer
45 views
'boost shared_ptr' and 'boost lock' together = messed up
I am new to both concepts shared_ptr and mutex (boost or not boost). I am trying to use it in my classes :
typedef boost::shared_mutex Lock;
typedef boost::unique_lock< Lock > WriteLock;
...
0
votes
1answer
39 views
timed_join(0) : no operator found which takes a right-hand operand of type 'const int'
I tried to check if a thread is running with use of timed_join(0). But unlike others, I get this error:
1>c:...\boost\thread\detail\thread.hpp(538): error C2679: binary '+' : no operator found ...
0
votes
0answers
46 views
NetBeans + Boost + Cygwin_4.x
I'm starting studies with C++ and need to create a project that uses threads.
My big problem is that I can't configure the boost library. I always get the same error message:
make[2]: Leaving ...
3
votes
2answers
311 views
boost::mutex::scoped_lock has been used and It sometimes throws the exception
I am using scoped_lock in my multithread code to exclusively access to some part of code, but sometimes it throws to the exception Access violation writing location ....
boost::mutex mMutex;
...
0
votes
0answers
101 views
Boost interprocess offset_ptr and boost threads for data transfer
I am trying to setup a system for writing continuous bytes of information(int) using boost's managed shared memory. This is a stripped down version of my class:
class PACKET_INFO
{
private:
...
0
votes
1answer
110 views
How to integrate boost thread(source files) into my own project
What I want is to put the source files about the boost thread(all necessary header and source files) into my own project so that other people don't need to configure the support of boost anymore. The ...
3
votes
1answer
110 views
Doing more than one atomic operations on shared variable
I want to do two operations on a shared variable. I need to guarantee that it can be done atomically. Can some one help me clarify if the following approach is correct:
#include <atomic>
...
0
votes
1answer
91 views
How to use boost::lambda to create new object for an existing pointer?
What I want to do is --> create a new object in a new thread.
Something like:
Class* object = 0;
Arg arg;
boost::thread t( lambda::bind( object = lambda::new_ptr< Class >()( boost::ref( arg ) ...
0
votes
3answers
115 views
boost two threads
C++ Boost question about loops.
So I've been looking over as much information as I can and still not seeing any examples of what I am trying to do or the principles of how it works.
I've been ...
0
votes
0answers
113 views
performance of boost::threads notify_one vs notify_all
I have an implementation of Semaphore to manage a shared resource using boost::threads. My implementation of the Semaphore is as shown below.
void releaseResource()
{
...
1
vote
1answer
404 views
Linking with GCC fails after switching boost version from 1.52 to 1.53
After upgrading the boost libraries form version 1.52 to 1.53 I get the following linker error when building with GCC under Linux. The same application builds fine under Windows with VC++10 and boost ...
4
votes
1answer
175 views
Bad Access in boost::future<>.then() after accessing given future
I'm developing for iOS in XCode 4.6. I'm writing a library for a service and use boost to start threads. One of my methods looks like this:
void ...
2
votes
1answer
76 views
how to overcome building error when I'm using bcp to export boost thread?
I'm using boost bcp tool to export thread library from boost. The layout of exported library is
- Jamroot
+ libs
|----- + thread
|----- + build
|----- - Jamfile.v2
+ ...
0
votes
1answer
78 views
Boost Asio, asynchronous server and video tracking
I need to trasmit with a (Boost) tcp server information collected in real time by the ARToolKit video tracking library.
Which is the right way of doing it?
I'm actually doing it with Boost threads ...
1
vote
2answers
249 views
Boost condition variables - do calls to “notify_one” stack?
In a single producer / single consumer application using Boost threads, what happens if the producer thread makes more than one call to cond_var.notify_one() before the consumer thread has called ...
0
votes
2answers
168 views
does boost::thread::timed_join(0) acquire a lock?
I need to check if my boost::thread I've created is running from another thread. This SO post explains you can do this by calling:
boost::posix_time::seconds waitTime(0);
...
0
votes
2answers
88 views
Boost Threading Conceptualization / Questions
I've got a function that is typically run 50 times (to run 50 simulations). Usually this is done sequentially single threaded but I'd like to speed things up using multiple threads. The threads don't ...
0
votes
1answer
69 views
C++ Boost::thread upgradable mutex “try upgrade lock”?
I implemented boost upgradable mutexes following the top answer here Example of how to use boost upgradeable mutexes
What I would like to do is to "try" whether or not the upgrade will block: if the ...
-1
votes
1answer
118 views
using Boost Thread for running a function on multiple threads with different input [closed]
Suppose I have a function which returns a map like:
std::map<std::string,std::string> functionname(string abc123)
How can I pass different string to same function in separate threads using ...
2
votes
1answer
154 views
Error: stray character when using c++11?
I'm running into a strange issue when I try to compile the following simple c++11 code on my machine:
#include <boost/thread/thread.hpp>
Compiles fine with g++ foo.cpp -o foo but chokes on ...
-1
votes
1answer
101 views
Boost mutex throw error on close for waiting threads
Is there a way to have a boost mutex throw an exception on any waiting threads? I have a problem where an object is deleted but do to the nature of the software library it is possible threads are ...
1
vote
1answer
138 views
Managing thread life-cycle in derived class
I have a Base class which acts as an interface to multiple strategies for synchronous event processing. I now want the strategies to process the events asynchronously. To minimize code refactor, each ...
0
votes
1answer
57 views
My process crash before main ,by datamngr.dll
My process crashes before main, on boost code:
myexe.exe!boost::`anonymous namespace'::run_thread_exit_callbacks() + 0xe6 bytes C++
The process written in c++ native for windows
The only strange ...
0
votes
1answer
93 views
C++ How to Catch a Exception Thrown by a Thread in Boost from the Thread-Spawning Function
I have a C++ application in which I use Boost Threads to provide concurrency. The basic sample is as follows:
processingThreadGroup->create_thread(boost::bind(process, clientSideSocket, this));
...
1
vote
0answers
108 views
Linking Boost-Python Hello World
I am trying to compile and link boost-python hello world example and I have some linking problems.
OS: Ubuntu
g++ -fPIC -w Test2.cpp -I ../../../Libs/Python/Python-2.7.3/Include -I ...
4
votes
1answer
73 views
what kind of multithreaded protection for this case?
I'm using C++, and I'm using the boost library mutex, recursive_mutex and other synchronization objects.
I often have the following pattern:
void RebuildAll(). This function makes many internal ...
0
votes
0answers
416 views
boost threadpool using boost::asio
I am trying to create boost threadpool using boost asio with a work queue. But I am stuck at one point, I need a monitoring function which should keep running and keep track of queue. I am not sure ...
1
vote
1answer
77 views
Is it possible to compile boost::recursive_mutex statically in C++ Builder
boost::recursive_mutex and boost::lock_guard seem to use boost_thread-bcb-mt-1_39.dll in C++ Builder 2010. I see that there is also static version - boost_thread-bcb-mt-1_39.lib.
My code is something ...
0
votes
1answer
59 views
How can I execute a function with boosts io_service.post() and use an array or pointer as parameter?
While trying to construct a program, which can transmit a block/array of data with boosts async_write, I probably ran into trouble with my threads:
This is what I would like to execute:
...
1
vote
2answers
703 views
Using boost::asio::io_service::post()
First i asked this Running a function on the main thread from a boost thread and passing parameters to that function
so now i am trying this:
The following is a console c++ project where i perfectly ...
0
votes
5answers
500 views
Creating a boost::thread with boost::bind() or without it
Some people seem to launch boost::threads using the boost::bind() function, like in the accepted answer of the following question:
Using boost thread and a non-static class function
Whereas other ...
0
votes
1answer
138 views
Running a function on the main thread from a boost thread and passing parameters to that function
I have some code running in a boost thread that modifies stuff handled by the main thread which is not working and it makes sense.
On android i would have the Handler which is a message queue that ...