From mboxrd@z Thu Jan 1 00:00:00 1970 References: <20160523120749.GB27631@hermes.click-hack.org> From: Jan Kiszka Message-ID: <5742F5F4.2020402@siemens.com> Date: Mon, 23 May 2016 14:22:12 +0200 MIME-Version: 1.0 In-Reply-To: <20160523120749.GB27631@hermes.click-hack.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : cobalt/kernel: Introduce __SCHED_CURRENT policy to setschedparam_ex List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix , xenomai@xenomai.org On 2016-05-23 14:07, Gilles Chanteperdrix wrote: > On Mon, May 23, 2016 at 12:40:00PM +0200, git repository hosting wrote: >> Module: xenomai-3 >> Branch: next >> Commit: c821cbaa31c4a816615a82d7cbbd049987da6f1a >> URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c821cbaa31c4a816615a82d7cbbd049987da6f1a >> >> Author: Jan Kiszka >> Date: Tue Mar 8 14:41:28 2016 +0100 >> >> cobalt/kernel: Introduce __SCHED_CURRENT policy to setschedparam_ex >> >> Define the internal scheduling policy "current": it shall refer to the >> target thread's current scheduling policy. This will allow to model >> pthread_setschedprio on top of pthread_setschedparam_ex with only a >> single syscall. > > I am not sure I understand the use of __SCHED_CURRENT all that well. > Since different scheduling policies have different priority ranges, > a particular priority may only make sense for a couple of scheduling > policies. This, means, to use __SCHED_CURRENT, the programmer has to > know the scheduling policy of the current thread anyway. So, since > he knows it, why not specifying it clearly? This will make the > application code more readable, will not change anything with regard > to the number of calls, and avoid to have to change Xenomai core. See "Wrap pthread_setschedprio for proper real-time support" for the use case. I'm open to address that one differently, via a separate syscall or whatever, if preferred. This one was just most simple. Jan -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux