From owner-freebsd-hackers@freebsd.org Sun Jan 8 23:27:07 2017 Return-Path: Delivered-To: freebsd-hackers@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 C4A3FCA6B0E for ; Sun, 8 Jan 2017 23:27:07 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell1.rawbw.com (shell1.rawbw.com [198.144.192.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB2C1398 for ; Sun, 8 Jan 2017 23:27:07 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from yv.noip.me (c-24-6-186-56.hsd1.ca.comcast.net [24.6.186.56]) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id v08NR1Zk032550 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Sun, 8 Jan 2017 15:27:01 -0800 (PST) (envelope-from yuri@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host c-24-6-186-56.hsd1.ca.comcast.net [24.6.186.56] claimed to be yv.noip.me To: Freebsd hackers list From: Yuri Subject: Why regular user with realtime priority can't run pthread_setschedparam(3) with sched_priority=10 ? Message-ID: <52cf051e-8c8a-d844-2756-9d2079cdd33d@rawbw.com> Date: Sun, 8 Jan 2017 15:26:59 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2017 23:27:07 -0000 The process (jackd) calls this code: > rtparam.sched_priority = priority; // =10 > if ((x = pthread_setschedparam (thread, SCHED_FIFO, &rtparam)) != 0) { It succeeds when the process is run as 'root'. It fails when the process is run as a regular user with realtime priority (set with rtprio 0): Operation not permitted Why realtime priority of the process doesn't make high priority threads possible? Yuri