From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 13 17:04:25 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4B20C16A401 for ; Tue, 13 Mar 2007 17:04:25 +0000 (UTC) (envelope-from peter_holmes2003@yahoo.com) Received: from web32914.mail.mud.yahoo.com (web32914.mail.mud.yahoo.com [209.191.69.114]) by mx1.freebsd.org (Postfix) with SMTP id 044BB13C458 for ; Tue, 13 Mar 2007 17:04:24 +0000 (UTC) (envelope-from peter_holmes2003@yahoo.com) Received: (qmail 1342 invoked by uid 60001); 13 Mar 2007 17:04:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=KjKcHNKXSWKD551IRMqZrENrC5BeDnCDn3Z76XJ+Ymfcpx9Qc5NItkusKlr9mkzpDJA797zwuuu8zzmBE2/I5p6M99TyhlP1swbydhp0dY+ozIHAAr6kU6JqTurU8s8FV2IvS4+n7uIjp8Fh8ewFuNTK6EY+o+s7J87az4PC+lQ=; X-YMail-OSG: C2m9Bl4VM1kB2tYIate_luh9F1ByE4_4ZySrB6SkHYV675z4.VvkC8UC.8HqTiIEbYJnae1hmJUwtTd4tAyqjmZGlSGbqcK27WOs5WNHLW.ctK3TllrxUk1tzhgF5eHrroohSuPuDDwMgzs- Received: from [207.17.136.151] by web32914.mail.mud.yahoo.com via HTTP; Tue, 13 Mar 2007 10:04:24 PDT Date: Tue, 13 Mar 2007 10:04:24 -0700 (PDT) From: Peter Holmes To: fbsd hackers MIME-Version: 1.0 Message-ID: <221230.1312.qm@web32914.mail.mud.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Pthread spin locks 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: Tue, 13 Mar 2007 17:04:25 -0000 I am not very sure about the spin lock behavior of pthreads. Here is the man page description: The pthread_spin_lock() function will acquire lock if it is not currently owned by another thread. If the lock cannot be acquired immediately, it will spin attempting to acquire the lock (it will not sleep) until it becomes available. For a single processor scenario. Let's say a pthread owns the lock and is blocked and now another thread tries to acquire it. Will the second thread not block until the first thread releases the lock. - Peter --------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit.