Is there any guarantee that the thread that calls locate on a
ServantLocator is the same that invokes the operation on the target
servant and then finished on the ServantLocator again ?
Regards,
Guido.
|
|
Is there any guarantee that the thread that calls locate on a
ServantLocator is the same that invokes the operation on the target
servant and then finished on the ServantLocator again ?
Regards,
Guido.
Yes, that is guaranteed. You can, for example, safely acquire a lock in locate() and release it again in finished().Originally posted by ganzuoni
Is there any guarantee that the thread that calls locate on a
ServantLocator is the same that invokes the operation on the target
servant and then finished on the ServantLocator again ?
Cheers,
Michi.
Except if you use AMD: Then the thread that finishes the request will also call finished().Originally posted by michi
Yes, that is guaranteed. You can, for example, safely acquire a lock in locate() and release it again in finished().
Cheers,
Michi.
In fact ! That's was my doubt.Originally posted by marc
Except if you use AMD: Then the thread that finishes the request will also call finished().
This means that if I need something identifying the "interaction" with
a Servant (locate, invoke, finish) I must rely on the cookie ?
If I understand well, there is also the chance for the thread that
dispatched a request to manage another one before the previous
gets completed, in the AMD scenario.
Well, the origin of all it's always the problem of managing
explicit Current vs ThreadLocalStorage approach.
A hypotetical TransactionCurrent object should be designed around
an InteractionLocalStorage concept rather than a ThreadLocal one.
This kind of local storage can be setup on locate() and cleared on
finished(), but works only with a ServantLocator.
Regards,
Guido.
Hi Marc,Originally posted by marc
Except if you use AMD: Then the thread that finishes the request will also call finished().
I have read chapter 15.6.3 and I am a bit confused.
Can you clarify which threads are distinct in the following
sequence of calls for an incoming request for both synch and
async method dispatch:
1. ServantLocator.locate
2. xxx.operation
3. ServantLocator.finish
Reading the doc I am not sure if the thread that executes 1. and 2.
is always the same, regardless the dispatch style, or not.
Regards,
Guido
For regular synchronous dispatch (non-AMD), all of the above is done by the same thread (the dispatcher thread).Originally posted by ganzuoni
Hi Marc,
I have read chapter 15.6.3 and I am a bit confused.
Can you clarify which threads are distinct in the following
sequence of calls for an incoming request for both synch and
async method dispatch:
1. ServantLocator.locate
2. xxx.operation
3. ServantLocator.finish
Reading the doc I am not sure if the thread that executes 1. and 2.
is always the same, regardless the dispatch style, or not.
Regards,
Guido
For AMD, (1) and (2) are done by the dispatcher thread, and (3) is done by the thread that finishes the AMD requests (i.e. calls back on the provided AMD callback object).
Cheers,
Marc
You mean that in AMD scenario the dispatcher thread invokesOriginally posted by marc
For regular synchronous dispatch (non-AMD), all of the above is done by the same thread (the dispatcher thread).
For AMD, (1) and (2) are done by the dispatcher thread, and (3) is done by the thread that finishes the AMD requests (i.e. calls back on the provided AMD callback object).
Cheers,
Marc
ServantLocator.locate
and
xx.<operation>_async
and another thread is activated by the invocation of
response.ice_response(..) (or exception as well) issued from within
xx.<operation>_async method body ??
Regards,
Guido.
Oops, please forgive and forget.
Everything is clear on page 428.
Really great doc upgrade !!
Regards,
Guido.
No, in the AMD scenario, the dispatcher thread invokes locate() and the operation. Whichever thread calls ice_response() on the callback object will also invoke finished(). No thread is activated for that, the application has to provide the thread that calls back on the AMD callback object.Originally posted by ganzuoni
You mean that in AMD scenario the dispatcher thread invokes
ServantLocator.locate
and
xx.<operation>_async
and another thread is activated by the invocation of
response.ice_response(..) (or exception as well) issued from within
xx.<operation>_async method body ??
Regards,
Guido.
There are currently 1 users browsing this thread. (0 members and 1 guests)