1

I'm looking for a way to share object between two processes. First process should create the object and the second should only copy it without making any change in the original.

Does anyone have an idea how to do that?

Chris Schmich
  • 29,128
  • 5
  • 77
  • 94
choppy
  • 739
  • 1
  • 12
  • 22
  • 2
    http://stackoverflow.com/questions/2004790/shared-memory-between-2-processes-applications - How to implement shared memory in .NET. – user854301 Aug 08 '12 at 05:10
  • 1
    @choppy no need to share the object cuz sharing the object doesn't make sense when you are providing only read access..Use `PipeStream` – Anirudha Aug 08 '12 at 05:18
  • You could always serialize the object.. depending on how it's constructed. – Simon Whitehead Aug 08 '12 at 05:54

2 Answers2

1

You don't need shared memory : the first process can expose a WCF (or .NET Remoting) service, and the second process will be able to call it. Make sure your object is serializable.

schglurps
  • 1,387
  • 1
  • 14
  • 26
  • That raises second question, what's the difference between using pipeStream and WCF? which is the batter choice of use? – choppy Aug 08 '12 at 08:01
  • 1
    WCF is an API that allows two processes (in fact two application domains), on the same computer or not, to communicate. With the same code, and simply by changing the configuration, the communication protocol can change : named pipes, TCP, HTTP MSMQ, ... You should first read a tutorial on WCF. – schglurps Aug 08 '12 at 08:16
0

in .net2.0 or lower you can not use wcf, but you can use some library like wcf, for example ICE Framework, you can download and read about it, on below link ICe Framewrok

kazem
  • 3,671
  • 1
  • 22
  • 21