boost-mutex Questions

2

Solved

I can use boost::lock_guard to acquire a lock on a boost::mutex object and this mechanism will ascertain that once the boost::lock_guard goes out of scope the lock will be released: { boost::lock...
Farfetched asked 19/4, 2014 at 6:58

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

2

Solved

I would like to know if there would be any issue if I hold two boost::scoped_locks at the same time. The locks are locking different mutexes. Consider the following example: void foo1() { boost::...
Copp asked 20/7, 2016 at 19:25

4

I try to get rid of some of the boost dependencies in my code and instead use the new C++11 features (Visual Studio 2013). In one of my components I used boost::mutex together with boost::lock_gua...
Paediatrician asked 6/1, 2015 at 14:9

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

2

Solved

I have a c++ class that allocates a lot of memory. It does this by calling a third-party library that is designed to crash if it cannot allocate the memory, and sometimes my application creates sev...
Selfmoving asked 20/3, 2014 at 21:44

2

Solved

I run the following program on a 32 cores computer: #include<iostream> #include<algorithm> #include<boost/thread.hpp> using namespace std; boost::thread_group g; boost::mutex _m...
Conradconrade asked 2/10, 2013 at 4:37

3

Solved

My shortened, simplified class looks as follows: class A { public: // ... methodA(); methodB(); protected: mutable boost::mutex m_mutex; sometype* m_myVar; } A::methodA( int someParam ) {...
Minatory asked 23/10, 2011 at 9:47
1

© 2022 - 2024 — McMap. All rights reserved.