python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Using a pointer to a Mutex (pthread_mutex_t *) in a structure, Instead of a global Mutex
I'm using a lock (pthread_mutex_t) in a program that launches a number of threads, all threads receives a pointer to a structure, which contains a pointer to this mutex.
So there is one initialized mu...

hugogogo
Votes: 0
Answers: 1
How to wake up multiple threads using condition variable
I want to run multiple threads every 100ms. In order to achieve that I thought of introducing std::mutex and std::condition_variable. The problem I'm facing is on what basis the threads should go into...
Harry
Votes: 0
Answers: 1
Using a mutex to limit instance of application is not respected if one instance if started from Visual Studio
In InitInstance of my dialog application I use this code to detect other running versions:
strOwner.LoadString(IDS_APP_MUTEX);
m_hMutex = ::CreateMutex(nullptr, FALSE, strOwner);
HWND hOtherInstance...
Andrew Truckle
Votes: 0
Answers: 0
Is mutex needed when all threads set flags in an array based on search result
I have a code block that looks like this
std::vector<uint32_t> flags(n, 0);
#pragma omp parallel for
for(int i = 0; i <v; i++) {
// If any thread finds it true, its true.
// Max value...
Oner
Votes: 0
Answers: 2