Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-01-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
ServantLocator and dispatching thread

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.
Reply With Quote
  #2 (permalink)  
Old 07-01-2003
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 889
Re: ServantLocator and dispatching thread

Quote:
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 ?
Yes, that is guaranteed. You can, for example, safely acquire a lock in locate() and release it again in finished().

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 07-01-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,772
Re: Re: ServantLocator and dispatching thread

Quote:
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.
Except if you use AMD: Then the thread that finishes the request will also call finished().
Reply With Quote
  #4 (permalink)  
Old 07-02-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
Re: Re: Re: ServantLocator and dispatching thread

Quote:
Originally posted by marc
Except if you use AMD: Then the thread that finishes the request will also call finished().
In fact ! That's was my doubt.
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.
Reply With Quote
  #5 (permalink)  
Old 07-10-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
Re: Re: Re: ServantLocator and dispatching thread

Quote:
Originally posted by marc
Except if you use AMD: Then the thread that finishes the request will also call finished().
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
Reply With Quote
  #6 (permalink)  
Old 07-10-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,772
Re: Re: Re: Re: ServantLocator and dispatching thread

Quote:
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 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
Reply With Quote
  #7 (permalink)  
Old 07-10-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
Re: Re: Re: Re: Re: ServantLocator and dispatching thread

Quote:
Originally 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
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.
Reply With Quote
  #8 (permalink)  
Old 07-10-2003
ganzuoni ganzuoni is offline
Registered User
 
Name: Guido Anzuoni
Organization: Individual
Project: No specific project
 
Join Date: Jun 2003
Location: Italy
Posts: 46
Oops, please forgive and forget.
Everything is clear on page 428.

Really great doc upgrade !!

Regards,
Guido.
Reply With Quote
  #9 (permalink)  
Old 07-10-2003
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,772
Re: Re: Re: Re: Re: Re: ServantLocator and dispatching thread

Quote:
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.
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Abort thread in C# acbell Help Center 1 01-03-2006 04:05 PM
ServantLocator implementation DeepDiver Help Center 10 06-16-2005 09:50 AM
ice and ace thread conflict Clarke Fang Bug Reports 2 11-10-2004 08:35 AM
Ice::Thread and GUI with Qt catalin Help Center 5 09-08-2004 10:20 AM
ServantLocator::deactivate signature andreynech Bug Reports 1 05-23-2004 05:08 PM


All times are GMT -4. The time now is 07:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.