Reentrant code / Critical section / Atomic Section

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

 



Daniel Rodrick escribió:
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)
Not exactly... A "reentrant code" is a piece of code that is prepared to be accesed simultaneously by multiple threads of execution. The keyword is to be prepared.

"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).
"Critical section" is a piece of code that can cause (for example) race conditions in case of being accesed simultaneously by multiple threads of execution. Critical sections should therefor be protected against this.

"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).
More or less.

In that sense "Reentrant Code" seems to be just the opposite of
"Critical Section". Is this right?
I would not consider them as opposite.


Thanks,

Dan

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



Miguel Ángel
----------------------------------------- PLEASE NOTE -------------------------------------------
This message, along with any attachments, may be confidential or legally privileged. It is intended only for the named person(s), who is/are the only authorized recipients.
If this message has reached you in error, kindly destroy it without review and notify the sender immediately.
Thank you for your help.
µSysCom uses virus scanning software but excludes any liability for viruses contained in any attachment.

------------------------------------ ROGAMOS LEA ESTE TEXTO -------------------------------
Este mensaje y sus anexos pueden contener información confidencial y/o con derecho legal. Está dirigido únicamente a la/s persona/s o entidad/es reseñadas como único destinatario autorizado. Si este mensaje le hubiera llegado por error, por favor elimínelo sin revisarlo ni reenviarlo y notifíquelo inmediatamente al remitente. Gracias por su colaboración. µSysCom utiliza software antivirus, pero no se hace responsable de los virus contenidos en los ficheros anexos.

--
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