From: Peter Soetens Date: Tue, 15 Jan 2008 13:34:18 +0100 References: <200801141627.32289.peter.soetens@domain.hid> <200801151024.53483.peter.soetens@domain.hid> <2ff1a98a0801150206r2977970ay445a18f65a025e5d@domain.hid> In-Reply-To: <2ff1a98a0801150206r2977970ay445a18f65a025e5d@domain.hid> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801151334.18090.peter.soetens@domain.hid> Subject: Re: [Xenomai-help] Is rt_task_set_mode( T_PRIMARY, 0, 0 ) temporary ? List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org On Tuesday 15 January 2008 11:06:13 Gilles Chanteperdrix wrote: > > A thread which blocks on a xenomai native mutex or semaphore will > switch to primary mode, it will not run under the Linux scheduler. > > > And we want a thread type that allows user code to go in endless > > loops without hanging the machine. In RTAI we did this creating an RTAI > > task which was run in the soft-rt mode. > > You should probably use a native task with priority 0, this task will > use the SCHED_OTHER policy when run by Linux scheduler, which means it > will not hang the machine. But of course, you will have to take care > that the loop does not take place in primary mode. The native API says that the lowest priority is '1' and not '0'. Or do you suggest I should use pthread_setschedparam or similar after a call to rt_task_set_mode(T_PRIMARY, 0, 0 ) ? > > > I believe a plain posix thread can not use the 'native' interface ? > > A plain posix thread can use some of the native interface services, > but not the blocking ones. Blocking a thread requires xenomai tasks > running in primary mode. Ok. Thanks for this clarification. It looks like I'll have to redesign some code to take into account these policies. I just wonder if staying in the primary domain after a 'blocking' call is what users of rt_task_set_mode() expect. Why are the flags not restored to what the user has set ? I'm just complaining from a user's perspective :-] Peter -- Peter Soetens -- FMTC --