From owner-freebsd-threads@freebsd.org Tue Oct 20 18:32:43 2015 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C5F6A1A324 for ; Tue, 20 Oct 2015 18:32:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C9501C62 for ; Tue, 20 Oct 2015 18:32:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0BA5BB94F; Tue, 20 Oct 2015 14:32:42 -0400 (EDT) From: John Baldwin To: freebsd-threads@freebsd.org Subject: Re: pthread_setprio seems to have no effect on a Raspberry Date: Mon, 19 Oct 2015 15:45:40 -0700 Message-ID: <4225038.8yBnzsdYvU@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20150801142416.24f39ba1@X220.alogt.com> References: <20150801142416.24f39ba1@X220.alogt.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 20 Oct 2015 14:32:42 -0400 (EDT) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2015 18:32:43 -0000 On Saturday, August 01, 2015 02:24:16 PM Erich Dollansky wrote: > Hi, > > I wondered that a multi threaded program of mine behaved strangely on a > Raspberry B+. So, it is the old single core version. Not matter what > priorities I give to two threads, I get the same result. > > While one thread generates messages and activates a condition, the > second thread reads the condition with pthread_cond_wait. > > I assume that on a single core system the reading thread should only > become active after the condition is set ejrm the feeding thread has a > lower priority than the reading thread. > > Reality is that the feeding thread is writing first all messages and > the reading threads starts reading them only after the feeding thread > stops feeding no matter which thread has the higher priority. I used > priority values like + and - 100, + and - 1, 0 and +1, 0 and -1 and 1 > and 2 in all possible combinations. > > When I run the same source on a multi core x86, it looks like one core > is generating while another core is reading. This is what I would > expect under these condition. > > All other settings for the two threads are default. > > Does anyone have an idea? If you use cpuset to restrict the x86 version to a single thread does it exhibit the same behavior as on the Pi? (e.g. cpuset -l 1 /my/program) -- John Baldwin