From owner-freebsd-threads@FreeBSD.ORG Fri Dec 21 07:00:07 2007 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D951A16A418 for ; Fri, 21 Dec 2007 07:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B60C213C4EB for ; Fri, 21 Dec 2007 07:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBL707vs002072 for ; Fri, 21 Dec 2007 07:00:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBL707MZ002071; Fri, 21 Dec 2007 07:00:07 GMT (envelope-from gnats) Date: Fri, 21 Dec 2007 07:00:07 GMT Message-Id: <200712210700.lBL707MZ002071@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/118910: Multithreading problem X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2007 07:00:07 -0000 The following reply was made to PR threads/118910; it has been noted by GNATS. From: David Xu To: Kuteynikov Dmitriy Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: threads/118910: Multithreading problem Date: Fri, 21 Dec 2007 14:56:35 +0800 Kuteynikov Dmitriy wrote: >> Number: 118910 >> Category: threads >> Synopsis: Multithreading problem >> Confidential: no >> Severity: serious >> Priority: high >> Responsible: freebsd-threads >> State: open >> Quarter: >> Keywords: >> Date-Required: >> Class: sw-bug >> Submitter-Id: current-users >> Arrival-Date: Thu Dec 20 23:10:01 UTC 2007 >> Closed-Date: >> Last-Modified: >> Originator: Kuteynikov Dmitriy >> Release: 7.0-BETA2 >> Organization: > MEPHI >> Environment: > FreeBSD av113962 7.0-BETA2 FreeBSD 7.0-BETA2 #0: Fri Nov 2 16:47:33 UTC 2007 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >> Description: > I have average computer: Athlon XP 2000+ with 1024 Mb RAM. When I listen music (in Rhythmbox) and move a window of any application for 3 or more seconds music stops to play. I haven't noticed this problem in previous releases. Is it multithreading problem in kernel? >> How-To-Repeat: > pkg_add -r fluxbox > pkg_add -r rhythmbox > startx > fluxbox > rhythmbox > Turn on music and move xterm window for some seconds. >> Fix: > > >> Release-Note: >> Audit-Trail: >> Unformatted: The kernel condition variable implementation is problematic, a thread sleeping on a condition variable does not raise its priority to some I/O priority, but most code will raise thread's priority to some level with msleep(). The code in sound driver use lots of cv_broadcast call(), it does not raise thread priority, this causes the music player does not have more chances to do I/O while other I/O bound applications will have. The kernel condition variable also causes top() to display incorrect priority because cv_wait does not update the priority but it is updated by cv_broadcastpri() which is too late for top to display. The kernel condition variable's initialization function should accept a thread priority parameter, and all thread sleep on the condition variable should use the priority. Regards, David Xu