From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 03C234670B for ; Sat, 8 Jul 2023 21:52:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 58AB968C59F; Sun, 9 Jul 2023 00:51:59 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0BD2C68C594 for ; Sun, 9 Jul 2023 00:51:53 +0300 (EEST) X-GND-Sasl: michael@niedermayer.cc Received: by mail.gandi.net (Postfix) with ESMTPSA id 761B1FF805 for ; Sat, 8 Jul 2023 21:51:52 +0000 (UTC) Date: Sat, 8 Jul 2023 23:51:51 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230708215151.GB1093384@pb2> References: <20230707140540.10279-1-nuomi2021@gmail.com> MIME-Version: 1.0 In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH v2 01/14] vvcdec: add thread executor X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============1409339420773693255==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1409339420773693255== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OJWLbGElk4npXSe3" Content-Disposition: inline --OJWLbGElk4npXSe3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 07, 2023 at 10:05:27PM +0800, Nuo Mi wrote: > The executor design pattern was inroduced by java > > it also adapted by python > > Compared to handcrafted thread pool management, it greatly simplifies the= thread code. > --- > libavcodec/Makefile | 1 + > libavcodec/executor.c | 182 ++++++++++++++++++++++++++++++++++++++++ > libavcodec/executor.h | 67 +++++++++++++++ > libavcodec/vvc/Makefile | 4 + > 4 files changed, 254 insertions(+) > create mode 100644 libavcodec/executor.c > create mode 100644 libavcodec/executor.h > create mode 100644 libavcodec/vvc/Makefile This seems to need some fallback if pthreads are unavailable src/libavcodec/executor.c: In function =E2=80=98executor_worker_task=E2=80= =99: src/libavcodec/executor.c:64:5: error: implicit declaration of function =E2= =80=98pthread_mutex_lock=E2=80=99; did you mean =E2=80=98ff_mutex_lock=E2= =80=99? [-Werror=3Dimplicit-function-declaration] pthread_mutex_lock(&e->lock); ^~~~~~~~~~~~~~~~~~ ff_mutex_lock src/libavcodec/executor.c:78:13: error: implicit declaration of function = =E2=80=98pthread_mutex_unlock=E2=80=99; did you mean =E2=80=98ff_mutex_unlo= ck=E2=80=99? [-Werror=3Dimplicit-function-declaration] pthread_mutex_unlock(&e->lock); ^~~~~~~~~~~~~~~~~~~~ ff_mutex_unlock src/libavcodec/executor.c:83:13: error: implicit declaration of function = =E2=80=98pthread_cond_wait=E2=80=99; did you mean =E2=80=98__fread_chk_warn= =E2=80=99? [-Werror=3Dimplicit-function-declaration] pthread_cond_wait(&e->cond, &e->lock); ^~~~~~~~~~~~~~~~~ __fread_chk_warn src/libavcodec/executor.c: In function =E2=80=98ff_executor_alloc=E2=80=99: src/libavcodec/executor.c:108:11: error: implicit declaration of function = =E2=80=98pthread_mutex_init=E2=80=99; did you mean =E2=80=98ff_mutex_init= =E2=80=99? [-Werror=3Dimplicit-function-declaration] ret =3D pthread_mutex_init(&e->lock, NULL); ^~~~~~~~~~~~~~~~~~ ff_mutex_init src/libavcodec/executor.c:112:11: error: implicit declaration of function = =E2=80=98pthread_cond_init=E2=80=99 [-Werror=3Dimplicit-function-declaratio= n] ret =3D pthread_cond_init(&e->cond, NULL); ^~~~~~~~~~~~~~~~~ src/libavcodec/executor.c:119:15: error: implicit declaration of function = =E2=80=98pthread_create=E2=80=99; did you mean =E2=80=98ff_thread_setname= =E2=80=99? [-Werror=3Dimplicit-function-declaration] ret =3D pthread_create(&ti->thread, NULL, executor_worker_task, ti= ); ^~~~~~~~~~~~~~ ff_thread_setname src/libavcodec/executor.c:129:5: error: implicit declaration of function = =E2=80=98pthread_cond_broadcast=E2=80=99 [-Werror=3Dimplicit-function-decla= ration] pthread_cond_broadcast(&e->cond); ^~~~~~~~~~~~~~~~~~~~~~ src/libavcodec/executor.c:132:9: error: implicit declaration of function = =E2=80=98pthread_join=E2=80=99; did you mean =E2=80=98ff_thread_once=E2=80= =99? [-Werror=3Dimplicit-function-declaration] pthread_join(e->threads[j].thread, NULL); ^~~~~~~~~~~~ ff_thread_once src/libavcodec/executor.c:133:5: error: implicit declaration of function = =E2=80=98pthread_cond_destroy=E2=80=99 [-Werror=3Dimplicit-function-declara= tion] pthread_cond_destroy(&e->cond); ^~~~~~~~~~~~~~~~~~~~ src/libavcodec/executor.c:135:5: error: implicit declaration of function = =E2=80=98pthread_mutex_destroy=E2=80=99; did you mean =E2=80=98ff_mutex_des= troy=E2=80=99? [-Werror=3Dimplicit-function-declaration] pthread_mutex_destroy(&e->lock); ^~~~~~~~~~~~~~~~~~~~~ ff_mutex_destroy src/libavcodec/executor.c: In function =E2=80=98ff_executor_execute=E2=80= =99: src/libavcodec/executor.c:180:5: error: implicit declaration of function = =E2=80=98pthread_cond_signal=E2=80=99 [-Werror=3Dimplicit-function-declarat= ion] pthread_cond_signal(&e->cond); ^~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors ffmpeg/ffbuild/common.mak:81: recipe for target 'libavcodec/executor.o' fai= led make: *** [libavcodec/executor.o] Error 1 make: *** Waiting for unfinished jobs.... thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope --OJWLbGElk4npXSe3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZKnacwAKCRBhHseHBAsP q6j4AJ4jqgA0RppSoKevJ8IZwwxhRh0A/gCfXbndc0gH+I8gXApH2cbUadxdjC8= =sWq9 -----END PGP SIGNATURE----- --OJWLbGElk4npXSe3-- --===============1409339420773693255== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============1409339420773693255==--