From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 15 14:52:37 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 994A916A422 for ; Thu, 15 Dec 2005 14:52:37 +0000 (GMT) (envelope-from guomingyan@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B89A43D67 for ; Thu, 15 Dec 2005 14:52:34 +0000 (GMT) (envelope-from guomingyan@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so309407wxc for ; Thu, 15 Dec 2005 06:52:34 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=e/19nb5fsJlyN9rHXNUgfP/dL7AEzV/7Af1oMKI8fiItCQTGB0FAEagD+Bt/0b9GBdf9SlXsfZu7yK/MqPjJFjkCF8gReYna0A4tQOjlGAICPD5+ubY8d/MRGvxKK+80BV1sEOfFOwYZ/zd35QYLPWLH5BcXJf9GAlKNFcOaewo= Received: by 10.70.20.10 with SMTP id 10mr2318391wxt; Thu, 15 Dec 2005 06:52:31 -0800 (PST) Received: by 10.70.39.18 with HTTP; Thu, 15 Dec 2005 06:52:31 -0800 (PST) Message-ID: <1fa17f810512150652h5da6a6a5g3347f841a614689e@mail.gmail.com> Date: Thu, 15 Dec 2005 22:52:31 +0800 From: prime To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Use turnstile to implement sx_lock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2005 14:52:37 -0000 hi hackers, I want to use turnstile to implement sx_lock( or read/write lock),but find that there is a big obstacle, ONE sx_lock needs TWO queues to put waiters on,one for readers and the other one for writers,but ONE turnstile can only supply ONE queue,and ONE sx_lock can only get ONE turnstile. I read opensolaris' rw_lock implementation and find that its turnstile has TWO queues which is different from FreeBSD's turnstile. Are there any good ideas to bypass the obstacle? Thanks very much. -- Three passions, simple but overwhelmingly strong, have governed my life: the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind. ---------Bertrand Russell