Cross-Process Locking in C#

I've written an API that will be used on the same box in (1) a windows service, (2) a web application, and (3) a windows forms application. They all need to share a very small set of common data (a few ints, a date, and a string that I could put as properties of a single class).

What sort of locking mechanism can I use cross-process so that the three processes can share the resources safely and not run into conflicts?

No databases please, looking for a solution that doesn't require additional dependencies. Preferably the solution would use shared memory, or the file system in some way.

16
задан Langdon 7 November 2016 в 17:06
поделиться