 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Siegfried Heintze Guest
|
Posted: Thu May 17, 2007 10:27 pm Post subject: OS agnostic substitute for Microsoft COM? |
|
|
{ This article is seemingly off topic, but I'm approving this because it may
lead to answers that are platform-independent and of interest to the global
C++ community. Follow-up posters are requested to stay on topic. -mod/sk }
We have an COM windows service (no user interface) application called the
Device Manager (DM) written in Visual Studio 6 and C++ that makes extensive
use of COM, MFC, MSXML, sockets and threading.
The main purpose of the DM is to use TCP/IP to implement a SOAP, FTP & HTTP
clients to asynchronously poll and configure teleconferencing devices (eg,
bridges, cameras, microphones) and make the collected information available
via a synchronous COM API. The DM is presently implemented as a COM Windows
service.
Our short term goal is to refactor it remove redundant code (the original
developers really believed in the power of cut and paste) so we can add
support for some new features.
Our long term goal is to refactor it to make it run on Linux.
Presently everything uses synchrounous COM. The asynchronous socket I/O is
implemented with two background threads that use critical sections to remove
objects from a linked list and use asynchronous socket I/O to implement the
SOAP, FTP and HTTP clients. (The fact that they are using multiple threads
and asynchronous socket I/O seems redundant to me).
For the short term goal I'm thinking of using asynchronous COM.
Is there an open source Linux & Windows friendly substitute for COM that
will marshal member function arguments between threads and processes like
asynchronous COM? I know RPC works between processes but I don't think it
accommodates threads or member functions.
Thanks,
Siegfried
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Mathias Gaunard Guest
|
Posted: Fri May 18, 2007 3:46 am Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
On May 18, 12:27 am, "Siegfried Heintze" <siegfr...@heintze.com>
wrote:
| Quote: | Is there an open source Linux & Windows friendly substitute for COM
that will marshal member function arguments between threads and processes like
asynchronous COM?
|
If it's serialization you need, there are dozens of libraries that do
such a thing.
| Quote: | I know RPC works between processes but I don't think it
accommodates threads or member functions.
|
Threads share the same memory.
There is no need to serialize anything.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Al Guest
|
Posted: Fri May 18, 2007 3:52 am Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
{ Edits: quoted signature removed. By the way, please don't top-post in
clc++m or clc++. See FAQ item 5.4 fourth bullet point. -mod }
Hi,
I'm not very familiar with it, but XPCOM might be what you are looking for.
http://www.mozilla.org/projects/xpcom/
There must be more lightweight and/or elegant solutions out there, though.
Boost.Interface, maybe?
Cheers,
-Al-
Siegfried Heintze wrote:
| Quote: | { This article is seemingly off topic, but I'm approving this because it may
lead to answers that are platform-independent and of interest to the global
C++ community. Follow-up posters are requested to stay on topic. -mod/sk }
We have an COM windows service (no user interface) application called the
Device Manager (DM) written in Visual Studio 6 and C++ that makes extensive
use of COM, MFC, MSXML, sockets and threading.
The main purpose of the DM is to use TCP/IP to implement a SOAP, FTP & HTTP
clients to asynchronously poll and configure teleconferencing devices (eg,
bridges, cameras, microphones) and make the collected information available
via a synchronous COM API. The DM is presently implemented as a COM Windows
service.
Our short term goal is to refactor it remove redundant code (the original
developers really believed in the power of cut and paste) so we can add
support for some new features.
Our long term goal is to refactor it to make it run on Linux.
Presently everything uses synchrounous COM. The asynchronous socket I/O is
implemented with two background threads that use critical sections to remove
objects from a linked list and use asynchronous socket I/O to implement the
SOAP, FTP and HTTP clients. (The fact that they are using multiple threads
and asynchronous socket I/O seems redundant to me).
For the short term goal I'm thinking of using asynchronous COM.
Is there an open source Linux & Windows friendly substitute for COM that
will marshal member function arguments between threads and processes like
asynchronous COM? I know RPC works between processes but I don't think it
accommodates threads or member functions.
|
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Siegfried Heintze Guest
|
Posted: Fri May 18, 2007 8:09 am Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
| Quote: | Threads share the same memory.
There is no need to serialize anything.
|
Asynchronous COM encapsulates the fact that a function implementation is
running on a seperate thread or process. I want some other framework to do
this so I don't have to code the critical sections, thread queues and
thread
pools myself.
I want the framework to make copies of the function arguments (marshal
them)
so that if the destination thread is busy, the framework will stick the
copies of the function arguments in some thread queue until the destination
thread can get to them. If the queue for the destination thread just
contains pointers to stack local variables that go out of scope (or change
value), I'll have problems.
Thanks,
Siegfried
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Robert Kindred Guest
|
Posted: Fri May 18, 2007 11:42 pm Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
[]
| Quote: | We have an COM windows service (no user interface) application called the
Device Manager (DM) written in Visual Studio 6 and C++ that makes
extensive
use of COM, MFC, MSXML, sockets and threading.
[]
Our long term goal is to refactor it to make it run on Linux.
|
It sounds to me as if you are describing COM for between-thread use and DCOM
for network use, although it might be that you have reinvented DCOM.
CORBA is the like-functionality on unix, which is essentially an
object-oriented RCP. I believe it is older than COM. With it, you can
instantiate objects on other machines and call their member functions. It
even supports the throwing and catching of exceptions across the network.
ACE/TAO is an open source example of CORBA. It is a free download. I do
not use this tool, so I cannot comment on its useability. ACE is the
communications part, and TAO is the CORBA layer on top of it. One problem
you can encounter is if your CORBA client wants to use an ORB (object
request broker) that is not running. I think only commercial products, such
as by Visigenics, will actually find and start a non-running service.
| Quote: |
Presently everything uses synchrounous COM. The asynchronous socket I/O is
implemented with two background threads that use critical sections to
remove
objects from a linked list and use asynchronous socket I/O to implement
the
SOAP, FTP and HTTP clients. (The fact that they are using multiple threads
and asynchronous socket I/O seems redundant to me).
|
A simpler system is the D-BUS messaging system I have read about on the
RedHat site. In a curious example of parallel evolution, we seem to have
invented our own messaging system simultaneously. It is too late for us to
switch. As I understand it, D-BUS allows (or forces) the programmer to do
his/her own marshaling by making him/her build his/her own messages. D-BUS
then routes the messages.
[]
| Quote: | Is there an open source Linux & Windows friendly substitute for COM that
will marshal member function arguments between threads and processes like
asynchronous COM? I know RPC works between processes but I don't think it
accommodates threads or member functions.
|
ACE/TAO runs on a multitude of systems, and both ACE/TAO and D-BUS are open
source and can be compiled to many targets.
[]
hth, Robert Kindred
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Guest
|
Posted: Sat May 19, 2007 1:42 pm Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
On May 18, 8:27 am, "Siegfried Heintze" <siegfr...@heintze.com> wrote:
| Quote: | Is there an open source Linux & Windows friendly substitute for COM that
will marshal member function arguments between threads and processes like
asynchronous COM? I know RPC works between processes but I don't think it
accommodates threads or member functions.
|
Hi Siegfried,
Have a look at
http://www.codeproject.com/threads/Rcf_Ipc_For_Cpp.asp
I've seen it used to replace DCOM in commercial enterprise
applications, and it runs on both Linux and Windows.
Jarl.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Le Chaud Lapin Guest
|
Posted: Sun May 20, 2007 3:34 pm Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
On May 17, 5:27 pm, "Siegfried Heintze" <siegfr...@heintze.com> wrote:
| Quote: | Presently everything uses synchrounous COM. The asynchronous socket I/O is
implemented with two background threads that use critical sections to remove
objects from a linked list and use asynchronous socket I/O to implement the
SOAP, FTP and HTTP clients. (The fact that they are using multiple threads
and asynchronous socket I/O seems redundant to me).
|
I have debated whether to reply since any reply I make can only be a
teaser.
My research group has exactly what you are looking for, but
unfortunately, it is proprietary. I guess the reason I am responding
is to at least encourage you to at least do what we did: make your
own.
As you know, there are many people attempting to find a usable,
portable, IPC framework. I know of one company that seems to have
done almost exactly what you described above. FYI, it is possible to
"have you cake and eat it". It is possible to have a C++ library that
has all the elements that you would encounter in distributed
communication, including:
1. serialization marshaling of data elements
2. naming
3. numbering
4. addressing
5. a base "server" class
6. derived classes of class server
7. dispatching of server objects (so that they run with their own
thread when dispatched)
8. portable threading and synchronization model
9. RPC framework, where services codes map to member functions of
derived "server" classes
10. security (authenticity and privacy using combination of symmetric
cryptosystem, asymmetric cryptosystem, hashing)
11. mobility (you probably don't need this)
12. multicasing (you probably don't need this)
It is possible to have a library that yields all of this in 1MB or
less of release-version binary code on Windows & Linux.
Some people mentioned TAO/ACE. We looked around the Internet to see
what publicly-available models were closest to ours, and TAO/ACE
seemed to be it, though ours is again, based on research, so ours is a
bit unconventional. Still, based on what we have learned, and given
the state-of-the-art in this area, I can assure you, the jury is still
out. If you decide to attack this problem, I can tell you that the
security system will be the least of your worries. The "meat" will be
the serialization, like what Boost provided, and finding a clean
threading model. Most importantly, do not underestimate
WaitForMultipleObjects on Windows, and its equivalent on Linux and
other OSes. It is required to arrive at a regular model for
distributed IPC.
Using existing concepts (IP addresses, etc..), Boost for
serialization, pre-fabricated crypto primitives, I would say that a
you are looking at about a year for a single (bright) engineer to put
the pieces together for something that works coherently and does not
have the feeling that it will lock up or crash at any moment, and
about 15 months to get it into a form that is has a low-enough
complexity barrier to be called a "framework".
Certainly you have experience the pain of the alternative - building
software soup from HTTP, COM, SSL, etc...I would avoid doing that
again. And I would definitely stay away from CORBA. No matter what
anyone says, functions with 12 arguments, in general, cannot be
considered virtuous primitives in a well-formed system.
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Mathias Gaunard Guest
|
Posted: Sun May 20, 2007 11:45 pm Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
On May 20, 5:34 pm, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
| Quote: | As you know, there are many people attempting to find a usable,
portable, IPC framework. I know of one company that seems to have
done almost exactly what you described above. FYI, it is possible to
"have you cake and eat it". It is possible to have a C++ library that
has all the elements that you would encounter in distributed
communication, including:
1. serialization marshaling of data elements
2. naming
3. numbering
4. addressing
5. a base "server" class
6. derived classes of class server
7. dispatching of server objects (so that they run with their own
thread when dispatched)
8. portable threading and synchronization model
9. RPC framework, where services codes map to member functions of
derived "server" classes
10. security (authenticity and privacy using combination of symmetric
cryptosystem, asymmetric cryptosystem, hashing)
11. mobility (you probably don't need this)
12. multicasing (you probably don't need this)
|
Isn't that just Boost.Channel, built on top of Boost.Asio,
Boost.Thread, Boost.Shmem and Boost.Serialization ?
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Pavel Vozenilek Guest
|
Posted: Sun May 20, 2007 11:46 pm Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
Jarl Lindrud wrote:
| Quote: | http://www.codeproject.com/threads/Rcf_Ipc_For_Cpp.asp
I've seen it used to replace DCOM in commercial enterprise
applications, and it runs on both Linux and Windows.
|
I was going to post this link. This is handy library for all C++
development and does not require any 3rd party tools like
code generator.
If your project uses several languages you may take look
on ICE (http://www.zeroc.com/, GPL & commercial licence)
which is similar (in features) to CORBA, with IDL and code generator.
/Pavel
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Le Chaud Lapin Guest
|
Posted: Mon May 21, 2007 4:59 am Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
On May 20, 6:45 pm, Mathias Gaunard <loufo...@gmail.com> wrote:
| Quote: | On May 20, 5:34 pm, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
1. serialization marshaling of data elements
2. naming
3. numbering
4. addressing
5. a base "server" class
6. derived classes of class server
7. dispatching of server objects (so that they run with their own
thread when dispatched)
8. portable threading and synchronization model
9. RPC framework, where services codes map to member functions of
derived "server" classes
10. security (authenticity and privacy using combination of symmetric
cryptosystem, asymmetric cryptosystem, hashing)
11. mobility (you probably don't need this)
12. multicasing (you probably don't need this)
Isn't that just Boost.Channel, built on top of Boost.Asio,
Boost.Thread, Boost.Shmem and Boost.Serialization ?
|
Perhaps.
I just took a quick look at Boost.Asio and Boost.Channel. I had seen
Boost.Serialization before.
Without denigrating Yigong Liu's work, I guess the difference with our
framework is that we tried very hard to keep the complexity barrier
low. We also provide mechanism, not policy, so that almost all of the
primitives have the abstraction level of, say, map<>. We have done
this for 150+ primitives. Then we define slightly more complex
classes from these primitives, but still simple enough that one should
be able to guess how to use most them by looking at list of member
functions. Then we get out of the way.
So I guess, yes, end the end, all of these frameworks, including ours,
get data from Point A to Point B. Of course, as far as I know, ours
is the only one that allows the source or target nodes of an Internet
connection to be moving at 50 km/hr, while still maintaining the
stream (with security, multicasting, etc), but again this is just
research.
Finally, all of the primitives involved, from threading, timing,
network, etc...were designed by a single individual and coded by the
rest of us, so there is a consistent feel to the class hierarchy and
reduction in complexity space as all the components fit more or less
compactly. As stated before, I am not sure this was a good idea, as it
implies that basic data structures like map<> or set<> from STL cannot
be used.
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
Mathias Gaunard Guest
|
Posted: Tue May 22, 2007 12:10 am Post subject: Re: OS agnostic substitute for Microsoft COM? |
|
|
On May 21, 6:59 am, Le Chaud Lapin <jaibudu...@gmail.com> wrote:
| Quote: | On May 20, 6:45 pm, Mathias Gaunard <loufo...@gmail.com> wrote:
Isn't that just Boost.Channel, built on top of Boost.Asio,
Boost.Thread, Boost.Shmem and Boost.Serialization ?
Perhaps.
I just took a quick look at Boost.Asio and Boost.Channel. I had seen
Boost.Serialization before.
Without denigrating Yigong Liu's work, I guess the difference with our
framework is that we tried very hard to keep the complexity barrier
low.
|
Boost.Channel is highly experimental and is not a boost library.
It is indeed a very complex library, and that's part of the reason
it's not in. Simplication and design changes are ongoing I think.
I just quoted it because it seemed to put many boost libraries
together to provide similar functionality to what you were talking
about.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ] |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|