Michael Kilburn
2007-11-07 19:54:34 UTC
Hi
It looks like there is a way to emulate "proper" Reactor pattern with
omniORB. Here is the trick:
- use ORB_CTRL mode
- install interceptors
- on receiving request or response -- lock mutex
- on request send/response -- unlock mutex
This gives semantic close to reactor pattern as implemented in Orbacus (i.e.
you could have nested calls of any depth) and your server will behave as in
single-threaded mode -- i.e. no need for synchronization headache.
Is anything wrong with this approach?
So far I see only these drawbacks:
- client (app that initiates call chain) can't work this way (you can't
unlock mutex that is not locked)
- one-way calls will require some additional treatment (they do not receive
response)
- I am not sure if it is ok to stay in interceptor for long time -- for
example, what will happen if it will stay there for 5 mins? for 1 second and
another request will arrive? In which context these interceptors are called,
is anything locked at that point in omniORB guts?
Thanks
It looks like there is a way to emulate "proper" Reactor pattern with
omniORB. Here is the trick:
- use ORB_CTRL mode
- install interceptors
- on receiving request or response -- lock mutex
- on request send/response -- unlock mutex
This gives semantic close to reactor pattern as implemented in Orbacus (i.e.
you could have nested calls of any depth) and your server will behave as in
single-threaded mode -- i.e. no need for synchronization headache.
Is anything wrong with this approach?
So far I see only these drawbacks:
- client (app that initiates call chain) can't work this way (you can't
unlock mutex that is not locked)
- one-way calls will require some additional treatment (they do not receive
response)
- I am not sure if it is ok to stay in interceptor for long time -- for
example, what will happen if it will stay there for 5 mins? for 1 second and
another request will arrive? In which context these interceptors are called,
is anything locked at that point in omniORB guts?
Thanks
--
Sincerely yours,
Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20071108/75534c27/attachment.htm
Sincerely yours,
Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20071108/75534c27/attachment.htm