sending periodic info from dll to interface

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all!

We are designing a dll that needs to send some information periodically to a
possible interface application that is listening to these messages.

The information, which consist on a complex structure with several fields,
must be sent periodically, and although the frequency depends on calculations
in the dll, on average we can say that a new message is being sent every 33
milliseconds.

Is very important to note that the dll must proceed with its work after
sending the message without waiting for the interface to finish reading the
new info. The dll does not care about the treatment that the interface is
doing and is not waiting for any results, so we can talk about an
asynchronous way of sending the information. Indeed, the dll doesn’t know
anything about the interface application, and it must be possible to develop
a new listener interface once the dll has been completely finished.

The dll is being developed in C++ using Microsoft Visual Studio .NET 2003
(.NET Framework 1.1) .

We would like to know what is the best way of achieving this communication:
what mechanism is the best one to use in the dll and how should an interface
listen to it.
If possible, we would like to know how to do it in two situations:

1. Supposing that any possible interface will be coded using .NET
environment (.NET Libraries, Managed code, etc…)
2. Thinking of a more general interface, that could be coded without using
..NET.


Thanks in advance!
 
Hello, aitzi!

a> 1. Supposing that any possible interface will be coded using .NET
a> environment (.NET Libraries, Managed code, etc…)
a> 2. Thinking of a more general interface, that could be coded without
a> using .NET.

If dll and interface are on the same process then you can use async delegates
( http://feeds.feedburner.com/LifeChronicles?m=13 )

If dll and interface are on separate processes then you can use
- memory mapped files ( can work without .NET but withi same machine )
- windows messages ( can work without .NET but within same machine )
- remoting ( uses .NET can work over multiple machines)
- sockets ( can work without .NET & can work on multiple machines)
- names pipes ( same as sockets )

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
 
Hi Vadym!

Thanks a lot for your answer, really!
My dll an interface will be running in the same machine, so I think I can
forget remoting, sockets and pipes. Now I have to choose between others.

I have already tried async delegates and windows messages, but I haven't
tried memory mapped files, has it got any advantages? (For instante, CPU
charge and speed are quite important in this application)
Regarding async delegates, I have two questions:
1. I can't use them if interface doesn't use .NET, can I?
2. If I'm not wrong, using async delegates means that a new thread is
automatically generated each time I send the info. In my case this results in
generating about 30 threads per second... isn't this a problem?


Thanks again!

Regards,

aitzi
 
Thanks again Vadym,

I'll do some more test and see how performation is affected.

Regards,

aitzi
 
Back
Top