From owner-cvs-src@FreeBSD.ORG Thu Mar 27 08:41:35 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A9451065692; Thu, 27 Mar 2008 08:41:35 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from itchy.rabson.org (mail.rabson.org [IPv6:2002:50b1:e8f2:1::143]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7338FC24; Thu, 27 Mar 2008 08:41:34 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from [IPv6:2002:50b1:e8f2:1:21b:63ff:feb8:5abc] (unknown [IPv6:2002:50b1:e8f2:1:21b:63ff:feb8:5abc]) by itchy.rabson.org (Postfix) with ESMTP id 5A6B33FB7; Thu, 27 Mar 2008 08:41:33 +0000 (GMT) Message-Id: From: Doug Rabson To: d@delphij.net In-Reply-To: <47EB1AD7.2080609@delphij.net> Content-Type: multipart/signed; boundary=Apple-Mail-119-666826560; micalg=sha1; protocol="application/pkcs7-signature" Mime-Version: 1.0 (Apple Message framework v919.2) Date: Thu, 27 Mar 2008 08:41:33 +0000 References: <200803261523.m2QFND30047541@repoman.freebsd.org> <47EB1AD7.2080609@delphij.net> X-Mailer: Apple Mail (2.919.2) X-Virus-Scanned: ClamAV 0.92/6417/Thu Mar 27 07:53:50 2008 on itchy.rabson.org X-Virus-Status: Clean X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: cvs-src@FreeBSD.ORG, Doug Rabson , src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen lockf.c src/lib/libc/sys Symbol.map fcntl.2 src/sys/compat/freebsd32 syscalls.master src/sys/compat/linux linux_file.c src/sys/compat/svr4 svr4_fcntl.c src/sys/conf NOTES files options ... X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Mar 2008 08:41:35 -0000 --Apple-Mail-119-666826560 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On 27 Mar 2008, at 03:56, Xin LI wrote: > Great work! I have not dig into the code yet but just curious - > will it be feasible to have the userland RPC client to share some > code to make it MTSAFE? I took the userland RPC code as a starting point but I have not tried to keep them compatible. The main issue for an MTSAFE RPC client is dealing with replies. The existing locking in the userland RPC code copes with sending the request messages safely but would have problems handling the replies if two threads were trying to read from the socket. It would be possible to take a similar approach to fixing this in userland. Basically you would build a list of pending requests and arrange for only one thread to read replies at any given time. That thread would examine each reply message and match it to a pending request by examining the XID field. The code is likely to be a bit different from the kernel version but the concept should be similar. --Apple-Mail-119-666826560--