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

Rémi Denis-Courmont remi at remlab.net
Thu Aug 27 19:42:49 CEST 2020


Le torstaina 27. elokuuta 2020, 20.09.31 EEST Romain Vimont a écrit :
> > You can use thread cancellation, if the threaded code supports it - but
> > most likely it doesn't, and there is a lack of static analysis support to
> > verify basic cancellation mistakes.
> > 
> > Again, it's much much easier and less error-prone to have a time-out
> > within
> > the thread.
> 
> But we must be able to cancel tasks like we currently do (preparsing,
> etc.)

So the runnable will be using poll(), vlc_cond_t, vlc_sem_t or some other wait 
method that supports timing-out. It might as well use that time-out capability 
instead of relying on a thread for the sole purpose of maybe (ab)using the 
interrupt callback on time-out.

Besides, timing out is an error that deserves logging. Interrupt is not. So 
using the same callback for both purpose looks dubious to me.

In fact, I don't see why you need the interrupt callback at all. The owner of 
the runnable has to know how to interrupt the runnable anyway. No need for the 
generic framework to know that any more than it needs to know the time-out.

-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list