Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack@foxmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/2] avutil/executor: Allowing thread_count be zero
Date: Tue, 18 Jun 2024 22:23:57 +0800
Message-ID: <tencent_6D35BD805A34173E8F57819CCCE1585BBA09@qq.com> (raw)
In-Reply-To: <CAFXK13ez83GwuaO1VjRuziHVJ2+=XWE6Gg0BJa6Kke8bTOtpfw@mail.gmail.com>



> On Jun 18, 2024, at 19:50, Nuo Mi <nuomi2021@gmail.com> wrote:
> 
> On Mon, Jun 17, 2024 at 5:28 PM Zhao Zhili <quinkblack@foxmail.com> wrote:
> 
>> 
>> 
>>> On Jun 17, 2024, at 16:45, Hendrik Leppkes <h.leppkes@gmail.com> wrote:
>>> 
>>> On Mon, Jun 17, 2024 at 10:03 AM Zhao Zhili <quinkblack@foxmail.com>
>> wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Jun 17, 2024, at 15:05, Anton Khirnov <anton@khirnov.net> wrote:
>>>>> 
>>>>> Quoting Zhao Zhili (2024-06-17 07:19:26)
>>>>>> From: Zhao Zhili <zhilizhao@tencent.com>
>>>>>> 
>>>>>> When thread_count be zero, it will be run on current thread like
>>>>>> !HAVE_THREADS.
>>>>> 
>>>>> Other APIs treat zero to mean "auto".
>>>> 
>>>> executor don’t detect cpu cores by itself. It’s more low level than
>> libavcodec.
>>>> 
>>>> Zero thread is zero thread, literally. If we use thread_count one to
>> mean
>>>> run on current thread, how to create a single thread then?
>>> 
>>> Whats the point of creating a single thread? Does the main thread ever
>>> do something else in the meantime, or does it just wait for the job
>>> anyway?
>> 
>> Executor as a basic infrastructure should support such usage. The caller
>> don’t need to wait for the job to finish.
>> 
> Hi Zhili,
> Thank you for the patch.
> Could you explain more about its usage?
> Why do we need to run everything in the main thread when we have pthread in
> the system?

In addition to match other decodes behavior, there are some usecases which
require the decoder to not create a thread at runtime. For example, when build
libavcodec with wasm and run in web browser, the runtime may or may not
support threads, threads number should be decided at runtime, and can be zero. 

> 
> Thank you.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2024-06-18 14:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17  5:19 Zhao Zhili
2024-06-17  7:05 ` Anton Khirnov
2024-06-17  7:21   ` Paul B Mahol
2024-06-17  8:02   ` Zhao Zhili
2024-06-17  8:45     ` Hendrik Leppkes
2024-06-17  9:27       ` Zhao Zhili
2024-06-18 11:50         ` Nuo Mi
2024-06-18 12:05           ` Steven Liu
2024-06-19  8:40             ` Nuo Mi
2024-06-19 10:39               ` Steven Liu
2024-06-18 14:23           ` Zhao Zhili [this message]
2024-06-19  8:51             ` Nuo Mi
2024-06-24  4:47 Zhao Zhili
2024-06-25 12:36 ` Nuo Mi
2024-06-27 12:57   ` Nuo Mi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_6D35BD805A34173E8F57819CCCE1585BBA09@qq.com \
    --to=quinkblack@foxmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git