This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Reentrant?

I rarely ask questions on this forum, but since I couldn't [easily] find it in the help-files, or on-line, I'm asking you guys.

I usually (like never) don't use the 'reentrant' pragma, but I think I may have to do that with a particular routine.

BUT I can't find the key-word that declares a function as reentrant. Am I missing something? Is there one for Keil's IDE tools? If so, what is its form? Can I get a link to the 'official' use of it?

Thanks in advance, and I need it asap because I need to pass this class and I don't want to really learn how to do this 'embedded' stuff anyway but the teacher keeps hounding me.

--Cpt. Vince Foster
2nd Cannon Place
Fort Marcy Park, VA

Parents
  • For the compiler, the possibility of recursion implies reentrancy. It's as simple as that. Hence, standard-compliant C compilers must produce reentrant functions by default.
    Although what you say is in part correct, could confuse people, the term reentrance is usually used with concurrency in mind not reentrancy.
    Reentrance: could ocurre when there are recursion, mutithreading or interruption happening asynchronously, and in these last cases the thing is more tricky and the compiler is not enought to make it reentrant.
    The compiler will just push the actual set of register into stack every times that enter to a function, wont care if has or not the same function signature.

Reply
  • For the compiler, the possibility of recursion implies reentrancy. It's as simple as that. Hence, standard-compliant C compilers must produce reentrant functions by default.
    Although what you say is in part correct, could confuse people, the term reentrance is usually used with concurrency in mind not reentrancy.
    Reentrance: could ocurre when there are recursion, mutithreading or interruption happening asynchronously, and in these last cases the thing is more tricky and the compiler is not enought to make it reentrant.
    The compiler will just push the actual set of register into stack every times that enter to a function, wont care if has or not the same function signature.

Children
No data