From owner-freebsd-hackers@freebsd.org Mon Jul 13 14:19:10 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA24E3652DF for ; Mon, 13 Jul 2020 14:19:10 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from smtp1.redcom.com (smtp1.redcom.com [192.86.3.143]) by mx1.freebsd.org (Postfix) with ESMTP id 4B55P96Ty7z40Sv for ; Mon, 13 Jul 2020 14:19:09 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from localhost (localhost [127.0.0.1]) by smtp1.redcom.com (Postfix) with ESMTP id 6C5B0A1C6 for ; Mon, 13 Jul 2020 10:19:03 -0400 (EDT) X-Virus-Scanned: amavisd-new at redcom.com Received: from smtp1.redcom.com ([127.0.0.1]) by localhost (smtp1.redcom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cv2dFabpYncx for ; Mon, 13 Jul 2020 10:19:01 -0400 (EDT) Received: from pie.redcom.com (pie [192.168.33.15]) by smtp1.redcom.com (Postfix) with ESMTP id 84365A1C7 for ; Mon, 13 Jul 2020 10:19:01 -0400 (EDT) Received: from exch-03.redcom.com (exch-03.redcom.com [192.168.32.32]) by pie.redcom.com (8.11.7p1+Sun/8.10.2) with ESMTP id 06DEJ1l25138 for ; Mon, 13 Jul 2020 10:19:01 -0400 (EDT) Received: from exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) by exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.330.5; Mon, 13 Jul 2020 10:19:01 -0400 Received: from exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f]) by exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f%3]) with mapi id 15.02.0330.010; Mon, 13 Jul 2020 10:19:01 -0400 From: "Wall, Stephen" To: "freebsd-hackers@freebsd.org" Subject: mutex locking on file descriptors? Thread-Topic: mutex locking on file descriptors? Thread-Index: AQHWWRoXEPt2d/knTkKX89CPrcZPAQ== Date: Mon, 13 Jul 2020 14:19:01 +0000 Message-ID: <0ae4590637e54a479228b38a823535a8@redcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.224.136] MIME-Version: 1.0 X-Rspamd-Queue-Id: 4B55P96Ty7z40Sv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of stephen.wall@redcom.com designates 192.86.3.143 as permitted sender) smtp.mailfrom=stephen.wall@redcom.com X-Spamd-Result: default: False [-0.81 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:192.86.3.143/32]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[redcom.com]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.63)[-0.633]; NEURAL_HAM_MEDIUM(-0.75)[-0.747]; NEURAL_HAM_SHORT(-0.23)[-0.228]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:46679, ipnet:192.86.3.0/24, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_COUNT_SEVEN(0.00)[7] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 14:19:10 -0000 I've been told by a co-worker that a freebsd developer once told him that m= utex locking on socket descriptors was not necessary to avoid issues with m= ultiple threads reading and writing. I would like to confirm this is true = of file descriptors as well, and in particular of device driver file descri= ptors, before I abandon them in my code. The driver in question is a simpl= e `usb_fifo_methods` type driver. Thanks. - Steve Wall