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

May I spceify all of functions are reentrant by directives?

Hello,

May I specify all of functions are reentrant function by directives?
I am using RXT51 tiny and my functions are reentrantable.
I am tired to declare "reentrant" at the end of every function declaration.

Thank you very much~

Parents
  • It is enough that just a couple of functions are not called from multiple threads or recursively for the compiler to be able to find call trees that it can optimize the parameter passing for.

    Are you saying that every function in your application is called from multiple threads? That most definitely sounds like you should take a closer look at your design!

    Your goal, when developing for '51 processors is to minimize the number of reentrant functions, not find easier way to declare every function reentrant. This is just as productive as asking how you can have the compiler upgrade every integer to 32-bit or maybe 64-bit, or how you can get the compiler to evaluate every single expression as floating point, or how you can get the compiler to treat every single variable as volatile without using the volatile keyword.

    Are you really, really sure that you have made a good split of your logic into separate tasks? From your description, it sounds more like all takss are doing basically the same thing, in which case all tasks will make use of the same set of functions.

Reply
  • It is enough that just a couple of functions are not called from multiple threads or recursively for the compiler to be able to find call trees that it can optimize the parameter passing for.

    Are you saying that every function in your application is called from multiple threads? That most definitely sounds like you should take a closer look at your design!

    Your goal, when developing for '51 processors is to minimize the number of reentrant functions, not find easier way to declare every function reentrant. This is just as productive as asking how you can have the compiler upgrade every integer to 32-bit or maybe 64-bit, or how you can get the compiler to evaluate every single expression as floating point, or how you can get the compiler to treat every single variable as volatile without using the volatile keyword.

    Are you really, really sure that you have made a good split of your logic into separate tasks? From your description, it sounds more like all takss are doing basically the same thing, in which case all tasks will make use of the same set of functions.

Children