[omniORB] How to write single threaded hydrid application..
Visscher, Bruce
VISSCHB at RJRT.com
Fri Feb 25 16:38:48 GMT 2005
> Cool. Didn't know that. But it still won't work if client and
> server share one
> thread, wouldn't it?
It sounds like you are having to use something that is inherently thread
unsafe.
I think that rather than trying to have a single threaded server (whether
or not it happens to also be a client of something else doesn't really
matter) that a better idea might be to avoid having to have a servant
in such an environment. You could then use something like the CosEvents
or CosNotification service as a buffering mechanism.
I.e., instead of a single threaded server, make that address space a
pull consumer client. Then you could periodically poll the event channel
using the try_pull method. Then what would have been a client under your
original design becomes a push supplier client of the event channel.
So, if you have a properly functioning CosEvents or CosNotification service
then you don't have to have any servers of your own at all and the threading
issue goes away.
Henning and Vinoski describes this as the "Hybrid Push/Pull Model".
Caveat: I haven't actually tried this but I think it would be an
interesting way to solve this problem that I see posted quite often here
and on comp.object.corba. I have also encountered situations where
multithreading must be avoided in (e.g.) some legacy applications.
Of course, you wouldn't have to use the actual CosEvents or CosNotification
service interface, but if you were starting from scratch that might be
a good place to start.
I would be interested in anyone that might have some actual experience
doing something like this.
Bruce
-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
contains information that may be confidential, protected by the attorney-
client or other legal privileges, and/or proprietary non-public
information. If you are not an intended recipient of this message or an
authorized assistant to an intended recipient, please notify the sender by
replying to this message and then delete it from your system. Use,
dissemination, distribution, or reproduction of this message and/or any of
its attachments (if any) by unintended recipients is not authorized and
may be unlawful.
More information about the omniORB-list
mailing list