[Spread-users] Is token hold?

Jonathan Stanton jonathan at cnds.jhu.edu
Sun Sep 29 13:35:05 EDT 2002


On Tue, Sep 24, 2002 at 07:21:47AM +0900, gulekim at samsung.co.kr wrote:
> Hi, all.
> 
> I am using Spread in my project and,
> 
> to get higher performance, I am investigating Spread source.
> 
> Today I found 'Is token hold' function ... It decides token hold state 
> 
> when 
> 
> Memb_state()==OP || Memb_state()==GATHER && Memb_token_alive() && Get_retrans(Last_token->type)<=1 && Aru == Highest_seq 
> 
> && Token_counter > 100 ==> at this moment what do you mean by Token_counter?
> 
> Why should I have to check Token_counter status and what is the role of this variable?

The Token_counter is a count of the number of times the token has cycled
around teh entire ring of daemons without doing any useful work (meaning
no daemon has sent new packets and all old packets were received by all
daemons). The check here stops the token from cycling continuously if no
useful work is being done. After 100 rotations liek that, the leader of
the ring stops the token and "holds" it until someone needs it again.
This avoids wasting network and CPU resources when Spread is not  busy.

Once a daemon has work to do teh token is restarted and will cycle until
the test in to_hold_token is true again.

Jonathan

-- 
-------------------------------------------------------
Jonathan R. Stanton         jonathan at cs.jhu.edu
Dept. of Computer Science   
Johns Hopkins University    
-------------------------------------------------------




More information about the Spread-users mailing list