Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2005

Tip: Looking for answers? Try searching our database.

Inter-process communication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Goatly - 19 Jan 2005 15:03 GMT
Hi all,

I'm having a slight issue with the speed of my inter-process communication
at the moment, and was wondering if anyone could either tell me either that I
won't get any more speed out of my current approach or how I can improve the
performance.

At it's simplest, the architecture of the application I'm writing will have
one "Message Handler" component and multiple other processes that will send
messages to it - it's important to note that all the other processes are
required to talk to the same message handler.

In its current incarnation the message handler is a remotable object
configured as a singleton, hosted in a windows service.  When a client starts
up, it creates the message handler using Activator.GetObject across a TCP
channel to the local machine.  (Is this required?  Is there a better
"channel" type to use? It really seems overkill for what I need...)

The client then simply calls a method on the message handler, for arguments
sake SendMessage(int, int, string) - n.b. no complex arguments.

I'm seeing a latency of about 0.0008 seconds between message calls, which
seems like an awfully long time to effectively just call a method.

Any pointers/suggestions will be gratefully received!
Many thanks,
Mike
Steven Cheng[MSFT] - 20 Jan 2005 02:07 GMT
Hi Mike,

Thanks for your posting. From your description, you've a service process
which expose a remote object as a MessageHandler. Other process (appdomain)
can get that remote object via remoting activation and call the method on
it to send message in the service process. But currrently you're concerning
about the speed the of the method call , yes?

Based on my experience, such cross-boundary calls( cross-appdomain,
cross-process ...) does need some additional time than a normal method
call. In fact, when we invoke a method on a remote object, the first step
occurs on the remote object's client side proxy in the client appdomain,
the proxy generate a Message object represent the method call then the
message go through several sinks and channels , and at the server
process(appdomain) the message is regenerated into stack based method call
on the actual object. So that'll take more time than a normal pure stack
based method call.

In addition, I notice that you're using the sendmessage  in your service
process. Since the SendMessage method will block the method call until the
the message's target window finish processing the message, I suggest you
can try use PostMessage or other async means instead which won't block the
method call. Also, you can also try remotely call a very simple method
(without send message) to see how long it will take and compare with the
method which send messages. That can also help to verify whether it's the
remote message exchange that eat the most times in a complete remote method
call.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.