[FFmpeg-devel] [RFC] Event loop

Lynne dev at lynne.ee
Fri Feb 19 15:47:24 EET 2021


Feb 19, 2021, 12:41 by george at nsup.org:

> Lynne (12021-02-19):
>
>> I found this document useful:
>> https://gist.github.com/andreybolonin/2413da76f088e2c5ab04df53f07659ea
>>
>
> Thanks. But I think this document makes it clear that what we, FFmpeg,
> need, is not libuv.
>
> In fact, after looking in the docs and in the source, I could not even
> find how we can use it: it does not seem to have an API to integrate
> foreign protocols.
>

https://github.com/libuv/libuv/tree/v1.x/docs/code
Pipes, file descriptors, sockets, examples.
The docs are even searchable: http://docs.libuv.org/en/v1.x/index.html


> Unless somebody points me that I am mistaken, it seems libuv is out and
> it will be libev.
>
>> Most high-level users have long since moved to asynchronous event
>> processing on threads, so having a synchronous single-threaded
>> implementation seems like somewhat behind with the times.
>>
>
> Yes, that is a terrible trend. Throw memory and CPU at I/O performance
> instead of writing optimized code. POSIX threads never were a solution
> for parallel I/O.
>

They kind of are, since I/O is blocking on most platforms, and you don't
want your event loop to grind to a halt if a disk read from an asleep HDD
is issued and libev's  event dispatch locks up everything else.
io_uring is still extremely new, no one wants to break API compatibility
with older kernels, and for some applications it's still unusable as new
additions make it into newer kernels that aren't even released yet.

You seem really prejudiced towards anything 'infected' by node, big data,
or http servers, but they've been solving the issues we have now since
before we knew we even had them.

While it's up to you to understand, the libuv community are definitely
going to help you if you just ask them a few questions about whether
it's suitable or not if you give them your requirements. They may even
do some work if there's something missing.



More information about the ffmpeg-devel mailing list