IPC Mechanisms in C# - Usage and Best Practices

Viewed 80612

I have used IPC in Win32 code a while ago - critical sections, events, and semaphores.

How is the scene in the .NET environment? Are there any tutorial explaining all available options and when to use and why?

6 Answers

I tend to use named pipes or Unix sockets (depending on whether I'm targetting MS.NET or Mono -- I have a class that abstracts it away) since it's easy to use, portable, and allows me to easily interoperate with unmanaged code. That said, if you're only dealing with managed code, go with WCF or remoting -- the latter if you need Mono support, since their WCF support simply isn't there yet.

There is also .NET Remoting, which I found quite cool, but I guess they are obsoleting it now that they have WCF.

It sounds as though you're interested in synchronization techniques rather than communication. If so, you might like to start here, or perhaps this more concise overview.

Related