From owner-freebsd-stable@FreeBSD.ORG Wed May 14 15:17:47 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1202F1065675; Wed, 14 May 2008 15:17:47 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 803DA8FC0C; Wed, 14 May 2008 15:17:46 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 6D149744002; Wed, 14 May 2008 18:17:44 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yEZM-GKnsmf5; Wed, 14 May 2008 18:17:44 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 13AE2744001; Wed, 14 May 2008 18:17:43 +0300 (EEST) Message-ID: <482B0297.2050300@icyb.net.ua> Date: Wed, 14 May 2008 18:17:43 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: freebsd-threads@freebsd.org, freebsd-stable@freebsd.org Content-Type: multipart/mixed; boundary="------------070900000602090808030708" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: thread scheduling at mutex unlock X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2008 15:17:47 -0000 This is a multi-part message in MIME format. --------------070900000602090808030708 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit I am trying the small attached program on FreeBSD 6.3 (amd64, SCHED_4BSD) and 7-STABLE (i386, SCHED_ULE), both with libthr as threads library and on both it produces "BROKEN" message. I compile this program as follows: cc sched_test.c -o sched_test -pthread I believe that the behavior I observe is broken because: if thread #1 releases a mutex and then tries to re-acquire it while thread #2 was already blocked waiting on that mutex, then thread #1 should be "queued" after thread #2 in mutex waiter's list. Is there any option (thread scheduler, etc) that I could try to achieve "good" behavior? P.S. I understand that all this is subject to (thread) scheduler policy, but I think that what I expect is more reasonable, at least it is more reasonable for my application. -- Andriy Gapon --------------070900000602090808030708--