2

Is there any way so that we can synchronize two independent processes? Like if they are sharing a resource, I would like to sync them.

I am using C#.

Sasha Chedygov
  • 127,549
  • 26
  • 102
  • 115
Sumeet
  • 905
  • 1
  • 14
  • 32

3 Answers3

5

you can use the Mutex class

see documentation here : http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx

Alon
  • 4,862
  • 19
  • 27
3

You can use WCF with pipe binding, or named synchronization objects, Mutex for example for synchronization between two processes

Arsen Mkrtchyan
  • 49,896
  • 32
  • 148
  • 184
1

Mutexes will give you cross process sync.

You could also implement an API in WCF using named pipes, which could give you a nice synchronisation in OO code without system calls and it fully unit testable. Named pipes would also give you not just sync but communication as well.

Spence
  • 28,526
  • 15
  • 68
  • 103