[vlc-devel] Re: vlc: svn commit r20432 (pdherbemont)

Pierre d'Herbemont pdherbemont at free.fr
Fri Jun 8 02:11:55 CEST 2007


On 8 juin 07, at 00:05, Damien Fouilleul wrote:

> i agree with Remi, you should only need events to cater for the  
> unexpected. Position change is an expected behaviour, only other  
> events such input buffer underflow/overflow, stop/pause, fast  
> forward, etc.. would affect that behaviour and i'd rather get  
> events for these rather than try to guess them from analyzing the  
> position behaviour.
> Regarding CPU wasting, polling is usually the best option as you  
> can schedule when you want to poll, which is usually in idle time  
> within an event loop, etc...

> Obviously, there are situations when you are better off with  
> events, which is usually, as i said before, when you are dealing  
> with unexpected changes. Because if you want to detect them through  
> polling you need to poll at the worse case frequency, and in the  
> case where it is a fairly high one, then you really start to waste  
> cpu time and sometimes you are not even guaranteed to catch the  
> change you are monitoring.

> Please note that events forces the consumer to process them at  
> unexpected time, and you can't always assume that a consumer is  
> always capable of processing events at the same rate or faster than  
> the publisher is pushing them, therefore the publisher needs to  
> implement smart strategies such as dropping less important events,  
> use collation, etc... whenever the event queue is full in order to  
> avoid stalls, are you willing to implement that as well ?

Well, I don't want to but if we need it... ;)

> I'm not trying to scare you off, but i know though experience, that  
> generating events is not always the best solution for every  
> situation, and can have perverse effects if badly used.

I really do get you're point. But the thing is, it is still way  
easier to use event for that sort of business.

I think I will continue to go on that direction. I'll tune the event  
handler a bit to receive the position event at a well enough pace. I  
am sure we can end up in something good and simple enough.

But anyway we are now kind of poll-ing for position event in the  
framework... So the polling triggers the event, which is what the  
consumer will do anyway. If a more fine-grained control is needed,  
the consumer can always set up his own polling behavior. Thus you can  
poll if you want or listen to event now. Choice is good.

Pierre.


-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list