From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 19 17:59:09 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 5B8B016A408 for ; Mon, 19 Mar 2007 17:59:09 +0000 (UTC) (envelope-from peter_holmes2003@yahoo.com) Received: from web32911.mail.mud.yahoo.com (web32911.mail.mud.yahoo.com [209.191.69.111]) by mx1.freebsd.org (Postfix) with SMTP id 23DE513C4B9 for ; Mon, 19 Mar 2007 17:59:08 +0000 (UTC) (envelope-from peter_holmes2003@yahoo.com) Received: (qmail 35328 invoked by uid 60001); 19 Mar 2007 17:59:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=K1BSflgMEQTmq7kTktW2dFS7Vmqp/N76oKkbOMBcTqoCMp+Szfv24yuXVxZI1rtCWh+J7x89a2wzWY8yzUW2WVaBUXg83Fi6lWjo54OJXf1eQyMPk7S8g4h7CdSSOD1Kqd9Dgl5kthGHqtNUoHYilPUZiCLY+z0CpwBAozX9LXY= ; Message-ID: <20070319175908.35326.qmail@web32911.mail.mud.yahoo.com> X-YMail-OSG: bGrKSfYVM1kRIJf9lkX8gEw_iJ2fG_ryDpzXak0f0_PybRgfONWgDk0yWNhkLOg5pXNYumg3z2ftlGvtGFvmqLq57Q9wiSUW_UQTtR21jv4dUXaaTRZrwI2bHI3TAKqEl6M4Fa3RtWijXBaazUs18kiK.g-- Received: from [66.129.224.36] by web32911.mail.mud.yahoo.com via HTTP; Mon, 19 Mar 2007 10:59:08 PDT Date: Mon, 19 Mar 2007 10:59:08 -0700 (PDT) From: Peter Holmes To: Peter Holmes , fbsd hackers In-Reply-To: <221230.1312.qm@web32914.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: 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: Mon, 19 Mar 2007 17:59:09 -0000 I have a related question - it would be great if someone could help me. Let's say there are multiple system scope pthreads running on an SMP system. Is there a chance that if a pthread holding a spinlock is scheduled out (due to a scheduling decision etc.) then other pthreads will be starved. Is there anything the system provides to guard against pthread starvation. Thanks, Peter Peter Holmes wrote: 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. _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta.