From owner-freebsd-threads@freebsd.org Sat Aug 1 06:24:34 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 A546F9B0A2B for ; Sat, 1 Aug 2015 06:24:34 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 771BCFE3 for ; Sat, 1 Aug 2015 06:24:34 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=v8Rn6fIETAPwrHRDHvqJQYyfWfUfCKpBz7NVMiJbpL8=; b=lYyGHph0avryXqUP56Pym1f3ZJ/NMS84lLGIKphnDm1FfC+dmezF6XzoRxF2j0kosRw9u64lU3+ZptMzJVikmuUdd5UXK/N5uTU9r6LFidbntgnJnrRABlV3BbvW4+91ZsLdBusQ3Opx0cqyBEACbpJDi/fAPdCzGDV/BHf7g+4=; Received: from [114.124.29.22] (port=61616 helo=X220.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZLQDa-001B3S-NA for freebsd-threads@freebsd.org; Sat, 01 Aug 2015 00:24:27 -0600 Date: Sat, 1 Aug 2015 14:24:16 +0800 From: Erich Dollansky To: freebsd-threads@freebsd.org Subject: pthread_setprio seems to have no effect on a Raspberry Message-ID: <20150801142416.24f39ba1@X220.alogt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: 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: Sat, 01 Aug 2015 06:24:34 -0000 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