From owner-freebsd-threads@FreeBSD.ORG Mon Jul 7 05:58:03 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C09D137B401 for ; Mon, 7 Jul 2003 05:58:03 -0700 (PDT) Received: from silver.he.iki.fi (silver.he.iki.fi [193.64.42.241]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9418A43FCB for ; Mon, 7 Jul 2003 05:58:02 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (localhost.he.iki.fi [127.0.0.1]) by silver.he.iki.fi (8.12.9/8.11.4) with ESMTP id h67CvxsL010162 for ; Mon, 7 Jul 2003 15:58:01 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <3F096E56.4010609@he.iki.fi> Date: Mon, 07 Jul 2003 15:57:58 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3) Gecko/20030501 X-Accept-Language: English [en],Finnish [fi] MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: thread scheduling priority X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2003 12:58:04 -0000 I have two threads on a SMP (2 CPU, HT disabled) box with world+kernel from mid-June. (cvsupping to latest right now) and a process which runs two threads with the following code snippet, more or less in a process & maintenance (collecting statistics, doing housekeeping, etc.) fashion. While the main thread does it's stuff it competes for a mutex with the other thread. However I'm observing that the thread created in the snippet below has hard time getting scheduled while the main thread is running. Am I missing something? No rtprio stuff here, contention scope is the default. { struct sched_param param; pthread_attr_t attributes; pthread_attr_init (&attributes); pthread_attr_getschedparam (&attributes,¶m); param.sched_priority += 5; pthread_attr_setschedparam (&attributes,¶m); pthread_create (&smem_thread,&attributes,&live_poll_sharedmem,0); } Pete