[tor-bugs] #6538 [Tor Client]: Use bit-twiddling tricks to make choose-by-bandwith algorithm even more time-invariant

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sun Aug 5 18:36:28 UTC 2012


#6538: Use bit-twiddling tricks to make choose-by-bandwith algorithm even more
time-invariant
-------------------------+--------------------------------------------------
 Reporter:  nickm        |          Owner:                    
     Type:  enhancement  |         Status:  new               
 Priority:  normal       |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client   |        Version:                    
 Keywords:               |         Parent:                    
   Points:               |   Actualpoints:                    
-------------------------+--------------------------------------------------

Comment(by rransom):

 Replying to [comment:2 nickm_mobile]:

 > That said, there is a much simpler fix, if we can trust the compiler not
 to get too smart.  Instead of setting i_has_been_chosen to 1 (as we do in
 the current code), set rand_bw t the o INT64_MAX (or whatever its type's
 max is).  Remove i_has_been_chosen. Should work I think.

 That would work, although you'll still need to switch to using integer
 math (rather than operating on the floating-point bandwidth values
 directly).

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6538#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list