From: Marcus M. <cod...@gm...> - 2012-03-28 18:54:57
|
Hi @all, [Michael Reinelt] > A (double) linked list has several memory objects. As many timers > are "one-shot timers" they may be created and destroyed very > regularly. This would lead to lots of malloc()/free() calls. But you do not have to destroy unused timers. If you'd had two timer list called 'tl_active' and 'tl_passive' you could hang passive timers to 'tl_passive' and 'add_timer' could take the first element of 'tl_passive' update its values an hang it to 'tl_active'. The list would take a little more memory (next pointer, tl_active, tl_passive) but it would be faster to find a free slot and you didn't have to realloc all timers if you had to create one more (tl_passive == NULL). [Michael Reinelt] > I think having both timers and timer groups is a nuisance. I agree: The two are to redundate to not be merged. (But I might lack the overview to see all features.) As Martin discribed the grouping makes sense. But couldn't this be already done in the timer.c? (double linked list) [Mattia Jona-Lasinio] > [...] I also find redundant the distinction between > one-shot timer and continuous timer. All timers should be one-shot. If > a timer wants to fire countinuously then it has to resubmit itself in > the callback function. I think that the whole timer framework would > benefit from this simplification. I think there should be only active (continuous) and passive timers and the callback should change its properties (or set it passive) instead of shot it ones and 'build' a new one. Regards Marcus -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a |