[LITMUS^RT] cli/sti and nonpreemptive sections

Björn Brandenburg bbb at mpi-sws.org
Thu Jan 16 18:49:22 CET 2014


On 16 Jan 2014, at 18:30, Glenn Elliott <gelliott at cs.unc.edu> wrote:

>  I can use cli/sti to disable/enable interrupts.  Is this sufficient to prevent the task from being descheduled?

Yes. To be descheduled, the core needs to carry out a context switch. A context switch must be triggered by an interrupt or an exception. If your task doesn't trigger an exception (which would probably crash the kernel anyway), int cannot be descheduled while interrupts are disabled.

By the way, the CPMD estimation code does exactly this.

- Björn





More information about the litmus-dev mailing list