tagged [mutex]

How can I create a System Mutex in C#

How can I create a System Mutex in C# How can I create a system/multiprocess Mutex to co-ordinate multiple processes using the same unmanaged resource. Background: I've written a procedure that uses ...

2 Feb at 18:56

Should I dispose a Mutex?

Should I dispose a Mutex? I'm working on 2 Windows Services that have a common database which I want to lock (cross-process) with a system Mutex. Now I'm wondering whether it's ok to just call `WaitOn...

18 Aug at 12:1

Whats is the difference between AutoResetEvent and Mutex

Whats is the difference between AutoResetEvent and Mutex I am new to these concepts. But as i am going deeper in `threading` i am getting confused. What is the significance of `mutex`, `semaphore` ove...

Concurrent HashSet<T> in .NET Framework?

Concurrent HashSet in .NET Framework? I have the following class. I need to change the field "Data" from different threads, so I would like some opinions on my current thread-safe implementation. ``` ...

Is using a Mutex to prevent multiple instances of the same program from running safe?

Is using a Mutex to prevent multiple instances of the same program from running safe? I'm using this code to prevent a second instance of my program from running at the same time, is it safe? ``` Mute...

19 Aug at 22:22

How to wait for a boolean without looping (using any kind of wait / semaphore / event / mutex, etc)

How to wait for a boolean without looping (using any kind of wait / semaphore / event / mutex, etc) I need to stop a thread until another thread sets a boolean value . What I currently have is the fol...

13 Sep at 18:11

Detecting if another instance of the application is already running

Detecting if another instance of the application is already running My application needs to behave slightly differently when it loads if there is already an instance running. I understand how to use a...

What is the correct way to create a single-instance WPF application?

What is the correct way to create a single-instance WPF application? Using C# and WPF under .NET (rather than [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms) or console), what is the corre...

18 Oct at 21:36

cross-user C# mutex

cross-user C# mutex My app is forced to use a 3rd party module which will blue-screen Windows if two instances are started at the same time on the same machine. To work around the issue, my C# app has...

4 Jun at 10:55

Run single instance of an application using Mutex

Run single instance of an application using Mutex In order to allow only a single instance of an application running I'm using mutex. The code is given below. Is this the right way to do it? Are there...

4 May at 11:55