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 F1D18428F5 for ; Tue, 5 Apr 2022 21:20:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8FFAB68AF71; Wed, 6 Apr 2022 00:19:59 +0300 (EEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn2057.outbound.protection.outlook.com [40.92.20.57]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3851C68AE6B for ; Wed, 6 Apr 2022 00:19:53 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LExEjWq8dM81c9kwQDIHPQ4hLhX9k/vb3cAPuqJukdt7xd1VxEynDeApOkJ60HvUwpzJ9+XjttrP5tJc8uc6XAJfHDR4n51GVgw0dYknMtuS32niE0AXzhqgCwMRkcMe0fjdoDAwNzLP83+OEEt3IZu+dXr/HsP0v8eItbOGQ1Dj9mgQVUtqTxyUTGQmukOr0tHPOtHdYRJKRcySbKMhCczydrhHaUZYua1OIv3Q9dtv3BM+dUXwhexP1aNCgVy/4Em+FFsgN86r9RSoWZkA0Zgfxs3n8mYgNXTQGTdj0rFhtMXaAvszrcfPSQjVbq4dqHyreY/24GayWYN6k6snDw== 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=5h84Nkj5CMrFKGeQjOhK0nB28K28jFeo67i1El9fr/E=; b=NlRMWhNT4edgcSd8gs8f7vkzbr4MDWPXpCWwz1fMi5thbio625N9OSJGzlAP0gb5/iROAyqHJF+/1LIy2O9bE7hQA+CTwKSgVOG4Oq9M7FzXCLB1hgjksf7Whv60wvf9bVzRwuAUj1g+t6pEOOzo6sELqKHpBD+51AttXVDpu8pF1WXyf/VHHl/xbrSkhohjZ1ayPAItyRcfGriBxflNrsX8D/btvPPHRsLnZL+1UFib6L9FIYtGAsQ/TnHdHC7ycL8F5Yz4tXsBsUyajwrxEI3rJBKuEe5YNKMrP3m87BTYeh4G3zs9+zBZB5SLGT2lbs/9OW76fB87l/3JRNDDbg== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5h84Nkj5CMrFKGeQjOhK0nB28K28jFeo67i1El9fr/E=; b=IpsARAbCAlDD5aEjlWgr9H6dR/T/xN3vPEdaioLL9avcwYrPPXaoVdnoqRC6cFUllXcETbiVa//BxcAlfGQfhnSahFCy8YtFUi1wKFAS8H/l8bQI3+LQmDUd9sE5+91Xtfd3Sv7KOJs59SAmr8jZVEhst9teZf2ID1Rkv4d3UDq27pprgN03SNH/kP77iBdbsJLF3ZQpr5l2/aFf/hGnOjxg7XWhQjdTj9h8+ttmfFWweJtipLbvn0k/qaxUoKeUNQHBbtwurBpoDSnJN6ZBuWUENd7H/62uy2SBfZr+6Tzt7XLp6/xMgYHEobxkzjtv4UA3CSvjX9n4HrXvHa3m0w== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by DM8P223MB0287.NAMP223.PROD.OUTLOOK.COM (2603:10b6:5:317::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.19; Tue, 5 Apr 2022 21:19:50 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::1d14:8778:3a51:ed0]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::1d14:8778:3a51:ed0%5]) with mapi id 15.20.5123.031; Tue, 5 Apr 2022 21:19:50 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [RFC] Switching ffmpeg.c to a threaded architecture Thread-Index: AQHYSBeuHAE+RPuGxESL7bK+MVIG+KzhsuYAgAAIfACAAAOyUIAAFjsA////4AA= Date: Tue, 5 Apr 2022 21:19:49 +0000 Message-ID: References: <20220404113037.13070-1-anton@khirnov.net> <20220405191542.GV2829255@pb2> <164918796468.24258.6158464741625303482@lain.red.khirnov.net> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [ibMQj/q87cL6N81ZBpV1ctWAJb/6aayC] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 31fb756d-af58-4b01-f0eb-08da174a04b5 x-ms-traffictypediagnostic: DM8P223MB0287:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UHYQCzrcT0aJd4osUCD0U2nRABMurdWTCUfFuI2eyyCcCukjq2zT4DkEJbLFFQgY6X8CH4mtK+6AFwh/ZneyfL8ld+tTyRfeXOJHi1EXzXpsMbr9cjm7pfNiStvZe5d+kWeDADBGubV9d4vK1yiSSvr4qLGxSIMd9FnJfCrMkL8rMVqagDwnKXrutfBekMQmNV+eOI2klb6jqQ085WNF8R+x4yA5poDfxnIFxdhKyHciXkP1YnkfmQnDccczRGiyOOaeg4Hv+tW369w/QBckTVPYQNJO4KiH59Ee1fsyryYSjqp8UAoDKbCx+6n/ccoKx1fdVQTXkajHY2jbfN3kZaNA+IXqHddQF0BE+R7QUVUG7+t7w3OeAFyhDfarntHg0uYKo8akutCOalQaesMUHPG9g+eZaft7+n7a75eKaDR16sqc7dQANn83NQxiKfnmqcdqfHm/0I0Ubj/a5HcvDCP5RzwF5D6Ig5Vd2Kwv/G8ov3rXc2wDxWF6X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S9ucjE4ZjNXTU1RYjJLa0xQ?= =?utf-8?B?dFBCbFI0VEZLZytDVUg1REZ1Tm95UVRqeUlwTStBV3kxc0FxQkwrOEVVUWhS?= =?utf-8?B?NXJoQlZUaUsrNWx3YjdDZEJYM3ZhazkvRGJxMTdPcHEveGdTckNyVTkzREpQ?= =?utf-8?B?QThBRjFEemxNNlY0NGFaUjJLZEwrUkF2c2FEaXV6dlY4MkVQS203elNQcExr?= =?utf-8?B?bEw4b3puZnJtVW95a1lKd3lBaU0rZlVmY3JOcHIrUm1WQTRDTTU2bVpEdGZj?= =?utf-8?Q?UELrjyHwSIY=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 31fb756d-af58-4b01-f0eb-08da174a04b5 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Apr 2022 21:19:49.9616 (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: DM8P223MB0287 Subject: Re: [FFmpeg-devel] [RFC] Switching ffmpeg.c to a threaded architecture 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: > -----Original Message----- > From: ffmpeg-devel On Behalf Of Paul > B Mahol > Sent: Tuesday, April 5, 2022 11:19 PM > To: FFmpeg development discussions and patches devel@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [RFC] Switching ffmpeg.c to a threaded > architecture > > On Tue, Apr 5, 2022 at 11:06 PM Soft Works > wrote: > > > > > > > > -----Original Message----- > > > From: ffmpeg-devel On Behalf Of > > > Anton Khirnov > > > Sent: Tuesday, April 5, 2022 9:46 PM > > > To: FFmpeg development discussions and patches > > devel@ffmpeg.org> > > > Subject: Re: [FFmpeg-devel] [RFC] Switching ffmpeg.c to a threaded > > > architecture > > > > > > Quoting Michael Niedermayer (2022-04-05 21:15:42) > > > > On Mon, Apr 04, 2022 at 01:29:48PM +0200, Anton Khirnov wrote: > > > > > Hi, > > > > > this WIP patchset is the first major part of my ongoing work > to > > > change > > > > > ffmpeg.c architecture such that every > > > > > - demuxer > > > > > - decoder > > > > > - filtergraph > > > > > - encoder > > > > > - muxer > > > > > lives in its own thread. The advantages of doing this, beyond > > > increased > > > > > throughput, would be enforced separation between these > components, > > > > > making the code more local and easier to reason about. > > > > > > > > > > This set implements threading for muxers. My tentative plan is > to > > > > > continue with encoders and then filters. The patches still > need > > > some > > > > > polishing, especially the last one. Two FATE tests do not yet > > > pass, this > > > > > will be fixed in later iterations. > > > > > > > > > > Meanwhile, comments on the overall approach are especially > > > welcome. > > > > > > > > I agree that cleanup/modularization to make the code easier to > > > > understand is a good idea! > > > > Didnt really look at the patchset yet. > > > > I assume these changes have no real disadvantage ? > > > > > > Playing the devil's advocate, I can think of the following: > > > 1) ffmpeg.c will hard-depend on threads > > > 2) execution flow will become non-deterministic > > > 3) overall resource usage will likely go up due to inter-thread > > > synchronization and overhead related to new objects > > > 4) large-scale code changes always carry a higher risk of > regressions > > > > > > re 1): should not be a problem for any serious system > > > re 2): I spent a lot of effort to ensure the _output_ remains > > > deterministic (it actually becomes more predictable for > some > > > cases) > > > re 3): I expect the impact to be small and negligible, > respectively, > > > but > > > would have to be measured once the conversion is complete > > > re 4): the only way to avoid this completely would be to stop > > > development > > > > > > Overall, I believe the advantages far outweigh the potential > > > negatives. > > > > Hi, > > > > do I understand it right that there won't be a single-thread > > operation mode that replicates/corresponds the current behavior? > > > > Not that I wouldn't welcome the performance improvements, but one > > concern I have is debugging filtergraph operations. This is already > > a pretty tedious task in itself, because many relevant decisions > > are made in sub-sub-sub-sub-sub-functions, spread over many places. > > When adding an additional - not even deterministic - part to the > > game, it won't make things easier. It could even create situations > > where it could no longer be possible to replicate an error in a > > debugger - in case the existence of a debugger would cause a > variance > > within the constraints of the non-determinism range. > > > > > Can you elaborate more?, otherwise this is PEBKAC. You mean like WKOFAIT? _______________________________________________ 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".