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

Rémi Denis-Courmont remi at remlab.net
Tue Sep 1 15:52:53 CEST 2020


Le tiistaina 1. syyskuuta 2020, 12.06.52 EEST Alexandre Janniaux a écrit :
> > I however doubt that futures would make much sense in VLC. C cannot
> > provide
> > the syntactic sugar to make them nice, nor the coroutines to make them
> > efficient. We also don't have a generic mean to wait on multiple futures.
> 
> In async client design, many things that are exposed in a
> synchronous way actually aren't really and are just here
> to make the code less tornado-like. In particular, a wait
> on multiple futures is actually only a task that will receive
> a status update from multiple other tasks and queue itself
> when it receives the correct count of updates.
> 
> Thus such primitive is not about finding a generic wait but
> instead finding a generic signaling.

I don't really get the distinction you're making here. Signaling and waiting 
are just two sides of the same mechanism.

My point is that we can't wait on multiple futeces, or anything built on top 
of them such as condition variables and semaphores.

> I agree that C lacks the sugar for coroutines,

I meant that C lacks syntactic sugar for templates/generics, so futures 
wouldn't easily be type-safe... and then there's really not that much left of 
futures as a concept.

C has coroutines. Way back, VLC even had a backend for GNU/pth. It's just so 
that coroutines _cannot_ be used in VLC anymore because they're incompatible 
with multithreading.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list