Interruption and preemption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
I've some questions about the preemption of the kernel. In the Linux 2.2 and 2.4, there are a lot of spin_lock_irqsave to disable interrupt like :
spin_lock_irqsave() ;
CRITICAL SECTION
spin_lock_irqrestore() ;
In a non preemptive kernel, the critical section is executed as an atomic operation that's sure. But in a preemptive kernel, the kernel can be interrupted by a process. So the kernel has a timeslice and if the timeslice finishes in the CRITICAL section, there's a problem.
And this code in SMP environment doesn't work neither, does it ? It only protects the interrupts of 1 processor no ?
Just some thoughts about synchronization :)


Thx :p

Eric


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux