记忆数据的状态会使函数不可重入。
Remembering the state of the data makes the function non-reentrant.
问题就是必须处理代码重入。
不可重入的函数不能由多个线程使用。
绝不调用任何不可重入函数。
绝对不调用不可重入的函数。
不可重入函数和静态变量。
指出了确保底层函数的可重入性的方法。
Suggests ways to ensure reentrancy of the underlying function.
讨论了在编译器层次上对可重入性的处理。
给出了示例,以说明不可重入性所导致的问题。
什么是可重入性?
出于以下任意某个原因,其余函数是不可重入的。
The rest of the functions are non-reentrant because of any of the following.
我将提出一个在编译器层次处理可重入函数的模型。
I would like to propose a model for dealing with reentrant functions at the compiler level.
返回指向静态数据的指针可能会导致函数不可重入。
Returning a pointer to static data may cause a function to be non-reentrant.
理解这五条最好的经验将帮助您保持程序的可重入性。
Sticking to these five best practices will help you maintain reentrancy in your programs.
另外,或许不可能让某个不可重入的函数是线程安全的。
Moreover, it may be impossible to make a non-reentrant function thread-safe.
双重入住:有多于一人入住的房间占总房间数目的比率。
通过修改函数的原型,您可以实现这个函数的可重入版本。
You can implement the reentrant version of this function by changing the prototype of the function. This listing provides storage for the output string
由进行调用的函数准备输出存储空间确保了函数的可重入性。
Providing output storage by the calling function ensures the reentrancy of the function.
定义了可重入性,并包含一个可重入函数的POSIX清单。
Defines reentrancy and includes a POSIX listing of a reentrant function.
这是可以接受的,因为我们的测试框架不是多线程的或可重入的。
It is acceptable because our test framework is not multithreaded or reentrant.
假定信号处理器使用了不可重入的gethostbyname。
Suppose that the signal handler USES gethostbyname, which is non-reentrant.
为了让它可重入,静态数据,即index,需要由调用者来维护。
To make it reentrant, the static data, the index variable, needs to be maintained by the caller. The reentrant version of the function could be implemented like this.
可重入函数可以在任意时刻被中断,稍后再继续运行,不会丢失数据。
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.
本文描述了在并行和并发程序设计中函数的不可重入性导致的一些潜在问题。
This article describes some potential problems due to non-reentrancy of the function in parallel and concurrent programming.
近来很多提供商已经开始提供标准c程序库的可重入版本,这是一个好消息。
The good news is, these days many vendors have taken the initiative to provide reentrant versions of the standard C library.
注意,这里遵循了标准惯例,通过向函数名添加“_ r”后缀来命名可重入函数。
Note that this follows a standard convention for the naming of reentrant function by suffixing the function name with "_r".
如果它是多线程的或可重入的,则必须用synchronized块保护我们自己。
If it were, we would have to protect ourselves with synchronized blocks.
如果它是多线程的或可重入的,则必须用synchronized块保护我们自己。
If it were, we would have to protect ourselves with synchronized blocks.
应用推荐