Re: Multi-threaded



Toralf Lund wrote:
Frank.Rehberger wrote:
Toralf Lund wrote:
First question: Is this list actually alive???
Yes, the list is alive, but little conversation going on ;)

Second question: Can anyone explain how to set up an ORBit2 server so
that it can process several requests in parallel via multi-threading?

Did you take a look at this page?

http://projects.gnome.org/ORBit2/orbit-docs/orbit/x1223.html#AEN1229
No. I didn't notice that example. Thanks.

I had actually tried parts of this, but I see at least one call that I'm assuming might make a difference:

*ORBit_ObjectAdaptor_set_thread_hint ((ORBit_ObjectAdaptor) child_poa, ORBIT_THREAD_HINT_PER_REQUEST);*

However, I don't really understand the example if it's supposed to run multiple threads. I mean, I can see only one extra thread getting created, and the original main thread doesn't do CORBA operations at all. But if there is just one thread doing CORBA, why do they bother to send "multi-threading" options to the POA?
OK. I figured it out eventually. The above mentioned call is pretty much the key to it all. I tried it earlier, but unfortunately, I had called it with the wrong "POA" object (the RootPOA rather than its child.) When I got it right, however, I the request would start running in threads of their own just like that - without the need for any threading calls as such.

So I really don't understand why the FAQ and example code has to drag threads created by the application into it all. This just confuses matters, as application threads and ORB threads have little to do with each other. To get multithreaded ORB operation you pretty much go about everything as if you were writing a single-threaded application, only you have to take care to set certain options on the POA object. Besides making sure the method implementation is thread safe, obviously...

- Toralf

This e-mail, including any attachments and response string, may contain proprietary information which is confidential and may be legally privileged. It is for the intended recipient only. If you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely on this e-mail in any way except as permitted by the author.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]