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 4657845C65 for ; Mon, 28 Aug 2023 17:06:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F1D0868C617; Mon, 28 Aug 2023 20:06:27 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2076568BF4D for ; Mon, 28 Aug 2023 20:06:22 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 553961C0004 for ; Mon, 28 Aug 2023 17:06:21 +0000 (UTC) Date: Mon, 28 Aug 2023 19:06:20 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20230828170620.GZ7802@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v5] 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="===============4583018455651801999==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4583018455651801999== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VhQAQpzZ5JFuTuOf" Content-Disposition: inline --VhQAQpzZ5JFuTuOf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 22, 2023 at 09:32:28PM +0800, Nuo Mi wrote: > The executor design pattern was inroduced by java inTroduced > > it also adapted by python > > Compared to handcrafted thread pool management, it greatly simplifies the= thread code. > --- > doc/APIchanges | 3 + > libavutil/Makefile | 2 + > libavutil/executor.c | 201 +++++++++++++++++++++++++++++++++++++++++++ > libavutil/executor.h | 67 +++++++++++++++ > libavutil/version.h | 2 +- > 5 files changed, 274 insertions(+), 1 deletion(-) > create mode 100644 libavutil/executor.c > create mode 100644 libavutil/executor.h >=20 > diff --git a/doc/APIchanges b/doc/APIchanges > index ad1efe708d..06822f22da 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-= 02-09 > =20 > API changes, most recent first: > =20 > +2023-08-22 - xxxxxxxxxx - lavu 58.18.100 - executor.h > + Add AVExecutor API > + > 2023-08-18 - xxxxxxxxxx - lavu 58.17.100 - channel_layout.h > All AV_CHANNEL_LAYOUT_* macros are now compatible with C++ 17 and olde= r. > =20 > diff --git a/libavutil/Makefile b/libavutil/Makefile > index 7828c94dc5..4711f8cde8 100644 > --- a/libavutil/Makefile > +++ b/libavutil/Makefile > @@ -31,6 +31,7 @@ HEADERS =3D adler32.h = \ > encryption_info.h \ > error.h \ > eval.h \ > + executor.h \ > fifo.h \ > file.h \ > frame.h \ > @@ -127,6 +128,7 @@ OBJS =3D adler32.o = \ > encryption_info.o \ > error.o \ > eval.o \ > + executor.o \ > fifo.o \ > file.o \ > file_open.o \ > diff --git a/libavutil/executor.c b/libavutil/executor.c > new file mode 100644 > index 0000000000..38adaef811 > --- /dev/null > +++ b/libavutil/executor.c > @@ -0,0 +1,201 @@ > +/* > + * Copyright (C) 2023 Nuo Mi > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1= 301 USA > + */ > +#include "internal.h" > +#include "mem.h" > +#include "thread.h" > + > +#include "executor.h" > + > +#if !HAVE_THREADS > + > +#define executor_thread_t char > + > +#define executor_thread_create(t, a, s, ar) 0 > +#define executor_thread_join(t, r) do {} while(0) > + > +#else > + > +#define executor_thread_t pthread_t I think *_t is reserved by POSIX should be ok otherwise thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein --VhQAQpzZ5JFuTuOf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZOzUCQAKCRBhHseHBAsP qx+xAJ0WAviiCzBkuZrsooKY2pvYY0NS3ACfWed3hM/NDV+kgr20WIH0KFOuTSo= =A4Us -----END PGP SIGNATURE----- --VhQAQpzZ5JFuTuOf-- --===============4583018455651801999== 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". --===============4583018455651801999==--