Jump to content

Inter-process communication help needed

- - - - -

  • Please log in to reply
4 replies to this topic

#1
barttoo

barttoo

    Newbie

  • Members
  • Pip
  • 4 posts
Hi,
I am new here. I need some help on inter-process communication.

I am developing a high performance console app in C# 4.0. The reason i chose console to winform because to minimize the GUI thread overheads. But i need to view the processing statistics from time to time (occasionally only, to check not monitoring). Just few variables values need to be accessed.

1. Is there a way like accessing web-service? let's say i have some volatile variables signed as public in a public class.

Any suggestion will be considered a help, as i need some ideas. Thank you guys.

#2
Momerath

Momerath

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 242 posts
You can have your main app create a shared memory space and store whatever you need there. Then your monitoring app can read the values it needs. This is faster than using pipes, RPC or WCF, but is restricted to running on the same machine as your main app.

#3
barttoo

barttoo

    Newbie

  • Members
  • Pip
  • 4 posts
Hi, thank you for the great idea. Is it possible to create the shared memory in C#. Assume, the whole application was written in C#.

If it could be done in C#, wouldn't creating shared-memory in the main app adds constrain to the application's heap? I am very concern about the main app's performance.

#4
Momerath

Momerath

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 242 posts
No, shared memory is just that, shared :) You can use Memory Mapped Files if you want to stick with safe code. If you are willing to use unsafe code, it's a little more complex but it is faster and you can directly map variables unto the memory space (this makes access to it just setting or getting the value of a variable). You'll have to deal with cross app signaling since you don't want one app writing while the other is reading :)

#5
barttoo

barttoo

    Newbie

  • Members
  • Pip
  • 4 posts
Hi, this is great idea. will try it and feed back. meanwhile thank you so much momerath.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users