Yoav,

Timing wheels are an efficient (O(1) amortized) data structure for 
maintaining lots of timers.  In SIPp there are three levels of timing 
wheel, each corresponding to a range into the future (0-4095 ms, 
4096-2^22-1ms, and 2^22 - 2^32-1 ms).  Each slot in the first wheel 
represents one millisecond.  Each slot in the second wheel represents 4096 
milliseconds, and each slot in the fourth represents 2^22 milliseconds. On 
insertion, the timer is put into the corresponding slot.  On each clock 
tick, a bucket from the first wheel is emptied.  If we have cycled through 
the first wheel, we migrate the next set of values in the second wheel to 
the first; and similarly when the second wheel is cycled we migrate values 
from the third wheel.  There is an additional "forever_list", which is 
used for calls that will never be woken up but for external stimulus 
(e.g., receiving a message).

All calls in SIPp belong to a running_calls list or the paused_calls 
timing wheel.  The timing wheel consists of many lists, but the proper 
list can be determined by the pause length.  The call structure has a 
runit and pauseit element, so that you can remove things from the 
appropriate list efficiently.

More information on timing wheels can be found in this paper:

Varghese, G. and Lauck, T. 1987. Hashed and hierarchical timing wheels: 
data structures for the efficient implementation of a timer facility. In 
Proceedings of the Eleventh ACM Symposium on Operating Systems Principles 
(Austin, Texas, United States, November 08 - 11, 1987). SOSP '87. ACM 
Press, New York, NY, 25-38. DOI= http://doi.acm.org/10.1145/41457.37504 

Charles

[EMAIL PROTECTED] wrote on 05/13/2007 04:06:12 AM:

> Hello,
>     I would really appriciate if you can give me a short explanation
> about the timewheel mechanism in the code. How the paused calls are 
maintined?
>     Why is the use of a "timewheel".
> Best
> 
Yoav-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Sipp-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sipp-users
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to