[vlc-devel] [RFC 0/2] New executor API

Romain Vimont rom1v at videolabs.io
Thu Aug 27 16:32:10 CEST 2020


On Thu, Aug 27, 2020 at 05:26:06PM +0300, Rémi Denis-Courmont wrote:
> Le torstaina 27. elokuuta 2020, 6.28.20 EEST Pierre Ynard via vlc-devel a 
> écrit :
> > > It's not a question of use case. It's a question of why the generic
> > > framework should have to care about a given aspect, consdering that
> > > the specific runnable will have to do the heavy lifting anyhow.
> > 
> > The task framework provides the convenient service of handling,
> > registering and firing the timeouts.
> 
> Wasting a thread only to fire the time-out, instead of having proper time-outs 
> in the task-specific code.
> 
> > I think that's worth it: threading code can be hard and error-prone,
> 
> Well sorry but I find passing a time-out value to poll() or 
> vlc_cond_timedwait() much easier and less error-prone than having another 
> thread invoke an ad-hoc callback to wake up the task thread and modify the 
> task state.

Yes, but vlc_executor_Cancel() may "interrupt" the task at any time, so
you have to handle it anyway (timeout or not).

And once you implemented it for cancelation, you do not want to handle
timeout separately.

> 
> -- 
> Реми Дёни-Курмон
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list