What kind of code can be called “re-entrant”?

前端 未结 9 1284
时光说笑
时光说笑 2020-12-24 02:34

Could someone tell me what code can be called \"re-entrant\" code?

I came across this word when reading some real time operating system. What disciplines must be st

9条回答
  •  温柔的废话
    2020-12-24 03:01

    Code that can be called by different threads running in parallel. So, the code:

    1. can have local variables (allocated on each thread's stack)
    2. should have guarded global and static variables, since the threads will be sharing them and there will be a race condition here.

提交回复
热议问题