Date: Mon, 19 Oct 2015 15:45:40 -0700 From: John Baldwin <jhb@freebsd.org> To: freebsd-threads@freebsd.org Subject: Re: pthread_setprio seems to have no effect on a Raspberry Message-ID: <4225038.8yBnzsdYvU@ralph.baldwin.cx> In-Reply-To: <20150801142416.24f39ba1@X220.alogt.com> References: <20150801142416.24f39ba1@X220.alogt.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4225038.8yBnzsdYvU>