[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reentrant code / Critical section / Atomic Section
Hi,
Can some body please confirm my understanding?
"Reentrant code" is a piece of code that could be simultaneously
running by multiple threads of execution. (either via SMP, or via
preemption on uniprocessor machines)
"Critical Section" is a piece of code that can be running by only one
thread of execution at a time ( If one thread enters critical section
on one processor, no other thread will enter critical section, even on
another processor).
"Atomic Section" is a piece of code that if starts running on a
processor, then it can't be preempted untill the atomic section is
exited. (it is however possible that the same atomic section is being
run simultaneously on a different processor by a different thread).
In that sense "Reentrant Code" seems to be just the opposite of
"Critical Section". Is this right?
Thanks,
Dan
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/