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 44F9C47C00 for ; Wed, 4 Oct 2023 11:08:02 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 28DE868CA67; Wed, 4 Oct 2023 14:08:00 +0300 (EEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2032.outbound.protection.outlook.com [40.92.50.32]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 47F8F68CA26 for ; Wed, 4 Oct 2023 14:07:53 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=am+RuZ9tqE/5Uuizl7hPsPRmy6vb6YoPKHDnmu+QsK/dQ2jL/SEOVSdO82jX+5MpX0q0PIIDm0NTsZyGWGPBG836RSmPCVbeXZGGfFw+e8eLeXcBP2movL7jdPWcsiuc16cpGC+wLto7SmYkMM4GVtq1VCUajWysaLdxsrksY30qb/Ez7FqqwwPPDCOSlB2tFqZofXddu3FR/Bfu3IQjOLZNWT2uCE6KP+uKb/gVc9MSOwxCY3Nju/RxpkhBE9P9VnEqbLUqcq3qg6VRn9hn9fKQK8jZDVULUvrOe8kXSvw1Ig39of0mLNxlZjCt385KQ9SzXX8FAR0vRDzF6Zltig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3VCtHGhTwTr0sqQpj0mUxy9pWkpkIafOS+mZBgCfqW0=; b=gMLL9Tk2JEMdY7Nit4Q9Qp9ABe1m3DsAWNt5lwpwUlsGfguf3WoF/6jE1ZD6Y4tT9LN85OS+WiR2ZzKyUmOxLiVFIwJxmFqW17VBJMgoRcTU68YB57Fx7FlNSUqe8cMCPyXVYs8+ImvpJnPKZ3wWiXGHvReFM6GqA+gdyn3YyayLLVpHH/FngteFxQmS8wCOObraspbTfCeRd0M1OSeuvXVjt4Hl/QxqWCGAud79VQ61+JW5xLu9r5j/GUdx0rcuIJ8WABzcSN42R27cevsJDn6je/XvcLlsoF6yWicuW3EoF3IqpAm8v0jlOSAMHn3ujxS0QCfGk/UvTX32Qb+lmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3VCtHGhTwTr0sqQpj0mUxy9pWkpkIafOS+mZBgCfqW0=; b=ROgeJT+ZNxNH+HTGo02BnJxarqHQdaR5tXgqHD0YHv+Zma7HipA98m3nWCx5MFCWPRWXu6ge5YSBG1svpEunAueFOtIYYHD9DjFyaLPYK5Cjrkgkmtv4AzM5uoZ1uv3u/F6z3YKhpi1NIXYY6wEF2oI3pllGq7JvXquxS4DlLZRL6NGVJDxcr8eG83IyhlDN6dMEaBzLpYlF6y5NfBgGDPFQ5ArTT4Wtjpo0PVatVsIp8Jrkq7sc1C/KrXtxWytIerT6+oWE6HUrZuA258m+9EWr6hLdKXumaPDo0HntaFaLD2lARK2O6qPu+ToTjnSQUn/Mtj7rS3NPAwVObh4wbg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AM8P250MB0107.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:36e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.35; Wed, 4 Oct 2023 11:07:51 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6792.026; Wed, 4 Oct 2023 11:07:51 +0000 Message-ID: Date: Wed, 4 Oct 2023 13:09:06 +0200 User-Agent: Mozilla Thunderbird To: FFmpeg development discussions and patches References: <169640876796.6638.6381125659317239402@lain.khirnov.net> Content-Language: en-US From: Andreas Rheinhardt In-Reply-To: <169640876796.6638.6381125659317239402@lain.khirnov.net> X-TMN: [49b8ruQ0rKfYET2K2ywOGACYFmpz45RF] X-ClientProxiedBy: ZR2P278CA0052.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:53::16) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <9b06e7b4-c0d6-4139-a90d-e11c3aad194b@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AM8P250MB0107:EE_ X-MS-Office365-Filtering-Correlation-Id: d9ef6e85-a85b-40cb-851d-08dbc4ca267e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OOABNoG4QXbonn/IZstWPxN/2/Si/uCss75WA7d3/gH1aUXRvuhU4Gg13f/SGfXteuatECGqUGZclcDMtlllX/xCxvKkEVZln1H04ALpP1mawAXD14bz6csLAjPRznU49rXcUrQivzClLb+WOPH8U/BvdpOqU/mk1IJ51mYvsbSyMt1phyvNJiM5iJgb8e46mXXHnBuq+PJcQU/Rmj2IMDmAMSC5z6y61Y1q32IHrlGQ2tpW4ifU19a/kySbVfYZGY1ukgfMnjKAk4OEMkiFKoIdcaLEhIas6BsXHHBEVn70YzjfFr7NIKVi+8XYCxvsVI0JsNhVeD8O5xT14yrjk55HdLvXbGNa7YtGsyqTxSCDpE1FFL3BTXI0SfLb2yILneKyyD649OF8aZzIup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EtJL1J2WkplWTEwUVJ3Y1U1WnJENWtU?= =?utf-8?B?VTU4VllzUnY5TktPUlE5TFJuWTJOOEMrZG1ueWNEbmpqTmx1WEZBb0toWmR2?= =?utf-8?Q?KdWxsErnjxxl+A4zjP8Q?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9ef6e85-a85b-40cb-851d-08dbc4ca267e X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 11:07:51.4005 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P250MB0107 Subject: Re: [FFmpeg-devel] [PATCH 17/42] avcodec/refstruct: Add RefStruct pool API 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Anton Khirnov: > Quoting Andreas Rheinhardt (2023-09-19 21:57:09) >> Very similar to the AVBufferPool API, but with some differences: >> 1. Reusing an already existing entry does not incur an allocation >> at all any more (the AVBufferPool API needs to allocate an AVBufferRef). >> 2. The tasks done while holding the lock are smaller; e.g. >> allocating new entries is now performed without holding the lock. >> The same goes for freeing. >> 3. The entries are freed as soon as possible (the AVBufferPool API >> frees them in two batches: The first in av_buffer_pool_uninit() and >> the second immediately before the pool is freed when the last >> outstanding entry is returned to the pool). >> 4. The API is designed for objects and not naked buffers and >> therefore has a reset callback. This is called whenever an object >> is returned to the pool. >> 5. Just like with the RefStruct API, custom allocators are not >> supported. >> >> (If desired, the FFRefStructPool struct itself could be made >> reference counted via the RefStruct API; an FFRefStructPool >> would then be freed via ff_refstruct_unref().) > > Considering that it's intended to be used from multiple threads, that > seems like the better option. Though I have not seen the following > patches yet, so maybe the advantage is not as big as I'd think. > It is implemented in patch #24. >> +/** >> + * If this flag is not set, every object in the pool will be zeroed before >> + * the init callback is called or before it is turned over to the user >> + * for the first time if no init callback has been provided. >> + */ >> +#define FF_REFSTRUCT_POOL_FLAG_NO_ZEROING FF_REFSTRUCT_FLAG_NO_ZEROING > > Do you think using the same namespace really improves things? It does > not seem so to me. > Actually, the namespaces are separate. The pool API uses FF_REFSTRUCT_POOL_FLAG_*, the ordinary RefStruct API uses FF_REFSTRUCT_FLAG_*. That some pool flags are simply mapped to non-pool flags is an implementation detail and does not join the namespaces. - Andreas _______________________________________________ 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".