[Repost] Globally disabling preemption

Keith Robertson kjrobert at alumni.uwaterloo.ca
Thu Nov 15 15:08:43 UTC 2007

[Rephrased question]
Possibly a stupid question, however, it'd be great to confirm/clarify 
the following:

Given a running RTEMS_NO_PREEMPT thread, A, is A guaranteed to run after 
an isr, regardless of any other threads the isr may make ready?

In general, in rtems is it safe to use RTEMS_NO_PRREMPT 
enabling/disabling as mechanism of protecting a critical section from 
other threads?



-------- Original Message --------
Subject: Globally disabling preemption
Date: Fri, 09 Nov 2007 15:32:03 +0000
From: Keith Robertson <kjrobert at alumni.uwaterloo.ca>
To: RTEMS mailing list <rtems-users at rtems.org>


The rtems user guide states: "If preemption is disabled for a task
(RTEMS_NO_PREEMPT), then the task will not relinquish control of the
processor until it terminates, blocks, or re-enables preemption."

Given an RTEMS_NO_PREEMPT thread A, I'd like to clarify what happens if
A is interrupted (as interrupts are still on).  When the scheduler runs
at the end of an isr, what happens?  Will A always be rescheduled?  Or
will the normal scheduling algorithm run and A may or may not be selected.

I suspect it's the later.  If this is the case, is there a recommended
way of globally disabling preemption so as to have the effect of the
former?  That is, A is interrupted, but is always rescheduled after the



rtems-users mailing list
rtems-users at rtems.com

More information about the users mailing list