线程安全函数不一定是可重入函数。
Thread-Safe Function:A function that may be safely invoked concurrently by multiple threads.
我将提出一个在编译器层次处理可重入函数的模型。
I would like to propose a model for dealing with reentrant functions at the compiler level.
定义了可重入性,并包含一个可重入函数的POSIX清单。
Defines reentrancy and includes a POSIX listing of a reentrant function.
可重入函数可以在任意时刻被中断,稍后再继续运行,不会丢失数据。
A reentrant function can be interrupted at any time and resumed at a later time without loss of data.
可重入函数要么使用本地变量,要么在使用全局变量时保护自己的数据。
Reentrant functions either use local variables or protect their data when global variables are used.
注意,这里遵循了标准惯例,通过向函数名添加“_ r”后缀来命名可重入函数。
Note that this follows a standard convention for the naming of reentrant function by suffixing the function name with "_r".
确保准则3得到满足,要求编译器预先知道所有可重入函数,包括应用程序所使用的程序库。
Ensuring guideline 3 requires the compiler to have prior knowledge of all the reentrant functions, including the libraries used by the application.
由进行调用的函数准备输出存储空间确保了函数的可重入性。
Providing output storage by the calling function ensures the reentrancy of the function.
指出了确保底层函数的可重入性的方法。
Suggests ways to ensure reentrancy of the underlying function.
通过修改函数的原型,您可以实现这个函数的可重入版本。
You can implement the reentrant version of this function by changing the prototype of the function. This listing provides storage for the output string
通过修改函数的原型,您可以实现这个函数的可重入版本。
You can implement the reentrant version of this function by changing the prototype of the function. This listing provides storage for the output string
应用推荐