Thread: [orbitcpp-list] Re: orbitcpp status and question
Status: Beta
Brought to you by:
philipd
|
From: John L. <jk...@lu...> - 2000-12-17 22:24:28
|
> Hello,
>
> I have been interested in C++ bindings for ORBit for sometime now,
> although I don't have a lot of time to keep up-to-date :-(. I have
> three questions.
>
I hope this won't have to do with velocity of swallows!
> 1. What is the current status of this project? After porting my program
> to use these bindings, I suddenly noticed a lot of important functions
> have error("NYI") (eg. deactivate_object). Any ideas when these
> functions will be implemented?
>
Alot is still not completed, but most of the POA stuff is. The example
you cite shows that the orbitcpp you are using is older than God, I
think a lot of this stuff is in the latest release. And if it isn't then
it certainly is in CVS. Of couse you also need to have a very late dev
snapshot (or CVS) of ORBit to use bleeding edge orbitcpp. Also do not
install this stuff in /usr or you will be sorry because precompiled
versions of GNOME depend on release ORBit, and will die with the latest
dev ORBit.
As for the pace, things seem to have slowed down. Everyone that writes
free software enjoys it, but most of us have jobs and or other
engagements necessary for survival. I have not heard from Phil Dawes
lately, and I would assume that this is the case with him. The holiday
season has made me awfully busy myself. The IDL compiler has come along
nicely, but there are still some issues with it that I am going to take
a look at over the next week. Hopefully things will settle down for the
other developers so that orbitcpp can pick up the pace.
If after installing CVS orbitcpp and ORBit, you find any NYIs for simple
things, reports to the mailing list are appreciated.
> 2. In C, it is not always safe to copy an object (eg CORBA struct
> containing interfaces and strings) using =, as only a shallow copy is
> created, and you risk freeing nested objects multiple times. Do the
> C++ bindings overload the copy constructor to create deep copies, or
> is this something which has to be done manually by the programmer?
>
> (this is IMHO one of the hardest aspects of CORBA programming -
> especially with C or C++ - knowing how/when to copy/free/deactivate
> objects - few examples seem to deal with these issues, but rely on
> memory being freed when the program exits).
The goal of this project is to faithfully implement the CORBA C++
mapping.
In the binding spec, deep copying is done sequences and arrays,
and orbitcpp tries to follow the spec.
Now if you (or anyone) finds places where compliant code crashes due to
a buggy copy (shallow where it should be deep), please contact the list.
>
> 3. Also, I noticed in <URL:http://gnome.dataplus.se/gnomefaq/html/x703.html>
>
> "...Now, that might be a shared library which got mapped into your
> address space and you are now doing straight function calls into
> it..."
>
> this is something that really interests me. From
> <URL:http://orbitcpp.sourceforge.net/> it says that a secondary
> objective is to "Allow C and C++ objects in the same address space to
> short-circuit calls (i.e. no on-the-wire marshalling) for maximum
> speed.", which I assume is the same thing.
In someway this is already done, as ORBit itself short circuits the
calls if the server is in the same address space. orbitcpp is merely
wrapping the stubs and skels of ORBit, and ORBit does this
optimization.
>
> Previously,I always thought CORBA objects had to run as separate
> processes or threads. I now get the impression that this is not the
> case. However, how do I construct an object as a shared library that
> is meant to be run from the same address space?
> --
> Brian May <ba...@sn...>
ORBit handles this sort of thing automatically. If the server is in the
same address space, when you deal with the IORs and the client resolves
the IOR, if the servant is in the same space, then the object reference
that the client gets will be "complete", and will have a pointer to the
actual entry point vectors for the servant The stubs check if the
CORBA_Object is complete and call the method directly instead of going
on the wire. Also, as long as you have the CORBA_Object from the
servant creation, it is totally safe to pass that around in client code,
I believe that the binding allows this.
John
>
> --__--__--
>
> _______________________________________________
> orbitcpp-list mailing list
> orb...@li...
> http://lists.sourceforge.net/mailman/listinfo/orbitcpp-list
>
> End of orbitcpp-list Digest
|
|
From: Brian M. <ba...@sn...> - 2000-12-19 05:23:18
|
>>>>> "John" == John Luebs <jk...@lu...> writes:
John> Alot is still not completed, but most of the POA stuff
John> is. The example you cite shows that the orbitcpp you are
John> using is older than God, I think a lot of this stuff is in
John> the latest release. And if it isn't then it certainly is in
No, this is the latest release, 0.29, from sourceforge. Of course, I
heard something about 0.30, but I don't think that is released yet.
Just do "grep NYI *.cc" shows a number of instances in one of the
source files:
orbitcpp_poa.cc: error("NYI");
orbitcpp_poa.cc: error("NYI");
orbitcpp_poa.cc: error("NYI");
orbitcpp_poa.cc: error("NYI");
orbitcpp_poa.cc: error("NYI");
those functions are activate_object_with_id, deactivate_object,
reference_to_servant, reference_to_id, id_to_servant, destroy.
If 0.29 isn't the newest release, then obviously I am looking at web
pages that are incorrect. In this case, where can I get the latest
version from?
Where can I find up-to-date instructions on obtaining the CVS version?
(ie. hostname, directory, and login details).
John> CVS. Of couse you also need to have a very late dev snapshot
John> (or CVS) of ORBit to use bleeding edge orbitcpp. Also do not
John> install this stuff in /usr or you will be sorry because
John> precompiled versions of GNOME depend on release ORBit, and
John> will die with the latest dev ORBit.
Hmmm. My current version of ORBit (0.5.5) seems OK at present. I will
upgrade though if I encounter problems.
John> The goal of this project is to faithfully implement the
John> CORBA C++ mapping. In the binding spec, deep copying is
John> done sequences and arrays, and orbitcpp tries to follow the
John> spec. Now if you (or anyone) finds places where compliant
John> code crashes due to a buggy copy (shallow where it should be
John> deep), please contact the list.
Ok, thanks for the information. If I have any problems, I will
post them here.
On the topic of the specs, I was wondering, how do I free object
references? I had a quick glance through the specs (probably should
check to ensure it is up-to-date: filename 99-07-41.pdf), but couldn't
find anything.
Currently I have:
void destroy() {
PortableServer::ObjectId *objid = poa->servant_to_id(this);
poa->deactivate_object(*objid);
CORBA_free(objid);
delete(this);
}
but not really sure if I have freed objid the correct way (isn't there
a C++ version of CORBA_free?)
--
Brian May <ba...@sn...>
|
|
From: Sam C. <sa...@to...> - 2000-12-19 05:57:59
|
Brian May <ba...@sn...> wrote: >=20 > No, this is the latest release, 0.29, from sourceforge. Of course, I > heard something about 0.30, but I don't think that is released yet. Not yet. There was some muttering about it, but the features planned for 0.30 aren't quite complete, and it looks like Phil has been too busy for the past few weeks to do much on it. Same story goes for me. > If 0.29 isn't the newest release, then obviously I am looking at web > pages that are incorrect. In this case, where can I get the latest > version from? >=20 > Where can I find up-to-date instructions on obtaining the CVS version? > (ie. hostname, directory, and login details). The project is hosted on SourceForge (http://orbitcpp.sourceforge.net/). There is a link to the CVS instructions from the main project page. For convenience, the link is: http://sourceforge.net/cvs/?group_id=3D646 > On the topic of the specs, I was wondering, how do I free object > references? I had a quick glance through the specs (probably should > check to ensure it is up-to-date: filename 99-07-41.pdf), but couldn't > find anything. >=20 > Currently I have: >=20 > void destroy() { > PortableServer::ObjectId *objid =3D poa->servant_to_id(this); > poa->deactivate_object(*objid); > CORBA_free(objid); > delete(this); > } >=20 > but not really sure if I have freed objid the correct way (isn't there > a C++ version of CORBA_free?) There's CORBA::free(), but I don't think that's the question you're really trying to ask. Since ORBit-C++ is just a wrapper around ORBit, you should be able to use CORBA_free() and CORBA::free() interchangably anyway. For instructions on freeing the object on the server side, see: http://lists.sourceforge.net/archives//orbitcpp-list/2000-October/000331.ht= ml But also see the "How to do garbage collection under CORBA" chapter in the ORBit Beginners Documentation, especially the "Difference between the client and the server" section, which clarifies the difference between and object and an object reference: http://icps.u-strasbg.fr/~genaud/ORBIT/c382.htm This should help you work out what you're really trying to do, so that you can then work out how to do it. I hope what I've given you helps. :) --=20 Sam Couter | Internet Engineer | http://www.topic.com.au/ sa...@to... | tSA Consulting | OpenPGP key available on key servers OpenPGP fingerprint: A46B 9BB5 3148 7BEA 1F05 5BD5 8530 03AE DE89 C75C |