[FFmpeg-devel] [PATCH 1/2] avutil/executor: Allowing thread_count be zero

Nuo Mi nuomi2021 at gmail.com
Thu Jun 27 15:57:38 EEST 2024


On Tue, Jun 25, 2024 at 8:36 PM Nuo Mi <nuomi2021 at gmail.com> wrote:

>
>
> On Mon, Jun 24, 2024 at 12:48 PM Zhao Zhili <quinkblack at foxmail.com>
> wrote:
>
>> From: Zhao Zhili <zhilizhao at tencent.com>
>>
>> Before the patch, disable threads support at configure/build time
>> was the only method to force zero thread in executor. However,
>> it's common practice for libavcodec to run on caller's thread when
>> user specify thread number to one. And for WASM environment, whether
>> threads are supported needs to be detected at runtime. So executor
>> should support zero thread at runtime.
>>
>> A single thread executor can be useful, e.g., to handle network
>> protocol. So we can't take thread_count one as zero thread, which
>> disabled a valid usercase.
>>
>> Other libraries take -threads 0 to mean auto. Executor as a low
>> level utils doesn't do cpu detect. So take thread_count zero as
>> zero thread, literally.
>>
>> Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>
>>
> Hi Zhili,
> Thank you for the v2
> I will merge it in 3 days if there are no objections.
>
Applied

>
>


More information about the ffmpeg-devel mailing list