Skip to main content
Filter by
Sorted by
Tagged with
412 votes
8 answers
146k views

The Mutex class is very misunderstood, and Global mutexes even more so. What is good, safe pattern to use when creating Global mutexes? One that will work Regardless of the locale my machine is in Is ...
Sam Saffron's user avatar
20 votes
5 answers
14k views

I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library. I'm planning to kick off OSG's render loop as a separate thread using boost::threads, passing a data structure ...
Brian Stewart's user avatar
6 votes
4 answers
12k views

MSDN says If the function fails, the return value is WAIT_FAILED. To get extended error information, call GetLastError. The code is: HANDLE m_mutex_handle; /**< m_mutex_handle. The ...
mat_geek's user avatar
  • 2,511
217 votes
8 answers
144k views

POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the ...
Mecki's user avatar
  • 135k
6 votes
2 answers
2k views

I'm mostly familiar with Java, C and C++ in which there are ways to control that only one thread is accessing a resource at any given time. Now I'm in search for something similar but in PHP 5.x. To ...
0 votes
2 answers
1k views

Each Java object (and its class) has an associated monitor. In pthread terms a Java monitor is equivalent to the combination of a reentrant mutex and a condition variable. For locking, the Win32 API ...
Matthew Murdoch's user avatar
128 votes
7 answers
100k views

I have seen this link: Implementing Mutual Exclusion in JavaScript. On the other hand, I have read that there are no threads in javascript, but what exactly does that mean? When events occur, where ...
Ovesh's user avatar
  • 5,399
3 votes
3 answers
974 views

I need to do some simple timezone calculation in mod_perl. DateTime isn't an option. What I need to do is easily accomplished by setting $ENV{TZ} and using localtime and POSIX::mktime, but under a ...
ysth's user avatar
  • 99.1k
19 votes
8 answers
44k views

After reading the Test-and-Set Wikipedia entry, I am still left with the question "What would a Test-and-Set be used for?" I realize that you can use it to implement Mutex (as described in wikipedia),...
Benoit's user avatar
  • 39.4k
30 votes
10 answers
36k views

I have an application where 2 threads are running... Is there any certanty that when I change a global variable from one thread, the other will notice this change? I don't have any syncronization or ...
fabiopedrosa's user avatar
  • 2,589
0 votes
1 answer
2k views

In VxWorks, I am creating a mutex with the SEM_INVERSION_SAFE option, to protect against the priority inversion problem. The manual says that I must also use the SEM_PRIORITY_Q option. Why is that?
Benoit's user avatar
  • 39.4k
5 votes
5 answers
2k views

I have a command line tool, written in Delphi, which job is to insert a node in a XML file and then immediately exit. I need to make it possible several instances of the tool to be executed ...
m_pGladiator's user avatar
  • 8,680
1020 votes
37 answers
701k views

Is there any difference between a binary semaphore and mutex or are they essentially the same?
Nitin's user avatar
  • 15.6k
9 votes
2 answers
4k views

I have a situation where I might have multiple instances of a program running at once, and it's important that just one specific function not be executing in more than one of these instances at once. ...
Redwood's user avatar
  • 69.8k
1033 votes
10 answers
534k views

A mutex is a programming concept that is frequently used to solve multi-threading problems. My question to the community: What is a mutex and how do you use it?
bmurphy1976's user avatar
  • 31.6k
744 votes
40 answers
268k views

Using C# and WPF under .NET (rather than Windows Forms or console), what is the correct way to create an application that can only be run as a single instance? I know it has something to do with some ...
Nidonocu's user avatar
  • 12.7k
28 votes
3 answers
10k views

I have imported the kernel32 library. So, I have the createMutex function available but I am not quite sure of the various parameters and return values. This is classic Visual Basic, not Visual Basic....
Goyuix's user avatar
  • 24.6k

1
93 94 95 96
97