[omniORB] How to get file descriptor from a CORBA request?
renny.koshy at rubixinfotech.com
renny.koshy at rubixinfotech.com
Sat Sep 30 10:01:36 BST 2006
Alberto:
We've done something where we have single-threaded code.
1. Receive the requests as normal
2. Construct a "request structure", which contains a semaphore
3. Add the request to a queue [this must be done with mutex protection so
that the queue itself isn't accessed by two threads at once]
4. Wait for the semaphore to be signalled
In the main thread which is the "single thread" of our code
1. Check for requests in the queue
2. Process a requests
3. signal the sempahore on the request that was just processed
4. go back to 1.
Renny Koshy
President & CEO
--------------------------------------------
RUBIX Information Technologies, Inc.
www.rubixinfotech.com
"Alberto Casado
Martín"
<alberto.casado.m To
artin at gmail.com> "Tuyen Chau" <tchau at verano.com>
Sent by: cc
omniorb-list-boun omniorb-list at omniorb-support.com
ces at omniorb-suppo Subject
rt.com Re: [omniORB] How to get file
descriptor from a CORBA request?
09/30/2006 04:50
AM
Hello,
Is there anyway we can force a single thread model in omniORB? It
will be a big job for us to
make our code thread safe.
Yes, you can do that configuring your POA in SINGLE_THREAD_MODEL.
12 CHAPTER 2. THE BASICS
Multi-threading
As omniORB is fully multithreaded, multiple threads may perform the
same
upcall to your implementation concurrently. It is up to your
implementation
to synchronise the threads' accesses to shared data. In our simple
example,
we have no shared data to protect so no thread synchronisation is
necessary.
Alternatively, you can create a POA which has the
SINGLE_THREAD_MODEL
Thread Policy. This guarantees that all calls to that POA are
processed sequentially.
Cheers.
Alberto.
2006/9/29, Tuyen Chau <tchau at verano.com>:
Duncan Grisby wrote:
> The normal approach is to put something in per-thread state. You don't
> want to put it on the servant object because multiple clients could
call
> a single servant concurrently.
>
> Cheers,
>
> Duncan
This brings up another problem for us that we didn't anticipate. Our
implementation unfortunately is not thread safe. Is there anyway we can
force a single thread model in omniORB? It will be a big job for us to
make our code thread safe.
Thanks for your response,
Tuyen
_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
More information about the omniORB-list
mailing list