Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Aug 2015 14:24:16 +0800
From:      Erich Dollansky <erichsfreebsdlist@alogt.com>
To:        freebsd-threads@freebsd.org
Subject:   pthread_setprio seems to have no effect on a Raspberry
Message-ID:  <20150801142416.24f39ba1@X220.alogt.com>

next in thread | raw e-mail | index | archive | help
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?

Erich



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150801142416.24f39ba1>