Discussion:
dotNet alternative to mailslot ?
Manu Jain
2002-10-29 19:41:04 UTC
Permalink
Hi All,

I have an existing real-time inter-process messaging COM component written
in C++ (ATL) that uses mailslots. When I use that component with dotNet
using interops, I face issues such as missed events. It also seems as if the
interop makes the component noticeably slower. Thus I want to develop a
similar dotNet component using C# or managed C++, but I am hesitant to use
remoting/MSMQ because of performance considerations. What is the closest
option to mailslots in dotNet? I looked into Streams, but didn't find what I
was looking for. Has anybody used remoting/MSMQ in real-time applications?
Is there any other option in dotNet apart from remoting/MSMQ to achieve
inter-process communication? My main consideration is speed - the upper
limit for a message to reach it's subscriber is one ms.

A little off the topic, is there any study/paper which compares the
performance of C# to managed C++? I am curious to know if there are any
performance differences bet. the two.

Thanks,

------------
Manu Jain
Sapphire Automation, Inc.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
Cavnar-Johnson, John
2002-10-29 20:31:28 UTC
Permalink
One millisecond is your upper limit? I don't think you want to use
managed code. A GC will almost certainly force you to miss that, no
matter what communication mechanism you use.

-----Original Message-----
From: Manu Jain [mailto:***@GOSAPPHIRE.COM]
Sent: Tuesday, October 29, 2002 1:41 PM
To: ADVANCED-***@DISCUSS.DEVELOP.COM
Subject: [ADVANCED-DOTNET] dotNet alternative to mailslot ?

Hi All,

I have an existing real-time inter-process messaging COM component
written
in C++ (ATL) that uses mailslots. When I use that component with dotNet
using interops, I face issues such as missed events. It also seems as if
the
interop makes the component noticeably slower. Thus I want to develop a
similar dotNet component using C# or managed C++, but I am hesitant to
use
remoting/MSMQ because of performance considerations. What is the closest
option to mailslots in dotNet? I looked into Streams, but didn't find
what I
was looking for. Has anybody used remoting/MSMQ in real-time
applications?
Is there any other option in dotNet apart from remoting/MSMQ to achieve
inter-process communication? My main consideration is speed - the upper
limit for a message to reach it's subscriber is one ms.

A little off the topic, is there any study/paper which compares the
performance of C# to managed C++? I am curious to know if there are any
performance differences bet. the two.

Thanks,

------------
Manu Jain
Sapphire Automation, Inc.

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
Jason Whittington
2002-10-29 21:56:17 UTC
Permalink
I'm pretty sure it's safe to say that there's nothing in the .NET
framework that works much like mailslots. Mailslots are sort of an
oddball relic of 16 bit windows networking.
Post by Manu Jain
was looking for. Has anybody used remoting/MSMQ in real-time
applications?
Post by Manu Jain
Is there any other option in dotNet apart from remoting/MSMQ to achieve
inter-process communication? My main consideration is speed - the upper
limit for a message to reach it's subscriber is one ms.
I assume you mean cross-process communications, since 1ms is plenty of
time in a single process. Frankly if your timing requirements are that
tight then I don't think .NET is likely to be an appropriate technology.
However the fastest way to get messages across would be to used a shared
memory section (i.e. CreateFileMapping / MapViewOfFile). There's no way
to access this natively in the libraries but I think some people have
build some classes to work with mapped files. If your timing ceiling is
1ms and there is a network involved then ..have fun.
Post by Manu Jain
A little off the topic, is there any study/paper which compares the
performance of C# to managed C++? I am curious to know if there are any
performance differences bet. the two.
Because of the way MC++ is compiled it's going to be almost impossible
to draw anything meaningful from such a study, because the performance
of a MC++ component will vary wildly depending on how it's been coded.
(much moreso than a C# component).

Jason

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
Manu Jain
2002-10-29 23:46:17 UTC
Permalink
Yes, its cross-process communication, and the 1ms ceiling is for
cross-process communication on the same machine (which in this case happens
90% of the time). If the objects reside over the network, then the timing
requirements are more lenient and for networks that cross the domain, the
component uses different "channels", so it's not an issue. Also, without
dotNet and Interops involved, the 1ms ceiling is very comfortably achieved
(surprise, surprise).

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:ADVANCED-***@DISCUSS.DEVELOP.COM]On Behalf Of Jason
Whittington
Sent: Tuesday, October 29, 2002 1:56 PM
To: ADVANCED-***@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] dotNet alternative to mailslot ?


I'm pretty sure it's safe to say that there's nothing in the .NET
framework that works much like mailslots. Mailslots are sort of an
oddball relic of 16 bit windows networking.
Post by Manu Jain
was looking for. Has anybody used remoting/MSMQ in real-time
applications?
Post by Manu Jain
Is there any other option in dotNet apart from remoting/MSMQ to achieve
inter-process communication? My main consideration is speed - the upper
limit for a message to reach it's subscriber is one ms.
I assume you mean cross-process communications, since 1ms is plenty of
time in a single process. Frankly if your timing requirements are that
tight then I don't think .NET is likely to be an appropriate technology.
However the fastest way to get messages across would be to used a shared
memory section (i.e. CreateFileMapping / MapViewOfFile). There's no way
to access this natively in the libraries but I think some people have
build some classes to work with mapped files. If your timing ceiling is
1ms and there is a network involved then ..have fun.
Post by Manu Jain
A little off the topic, is there any study/paper which compares the
performance of C# to managed C++? I am curious to know if there are any
performance differences bet. the two.
Because of the way MC++ is compiled it's going to be almost impossible
to draw anything meaningful from such a study, because the performance
of a MC++ component will vary wildly depending on how it's been coded.
(much moreso than a C# component).

Jason

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
Stefan Holdermans
2002-10-30 18:54:56 UTC
Permalink
Jason,
A little off the topic, is there any study/paper which compares the performance of C# to managed C++? I am curious to know if there are any performance differences bet. the two.
Because of the way MC++ is compiled it's going to be almost impossible to draw anything meaningful from such a study, because the performance of a MC++ component will vary wildly depending on how it's been coded. (much moreso than a C# component).
Could you elaborate on this a little more? I'm not sure if I'm getting it. In my view on the world, both a purely managed C++ program and it's equivalent in C# compile to IL and fit into the CLR. How could a performance difference occur? Of cource, when you mix managed and unmanaged code in a C++ program, you could gain a significant performance gain, but then it wouldn't be fair comparison, would it?

Regards,

Stefan

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
Loading...