相关疑难解决方法(0)

Threadsafe vs re-entrant

最近,我问了一个问题,标题是"malloc线程安全吗?" 在里面我问道,"malloc是否重新进入?"

我的印象是所有重入者都是线程安全的.

这个假设是错的吗?

c thread-safety reentrancy

84
推荐指数
3
解决办法
4万
查看次数

什么是可重入的解析器?

谁可以给我解释一下这个?特别是之间的区别:

http://github.com/whymirror/greghttp://piumarta.com/software/peg/

前者是后者的可重入版本.

parsing reentrancy

11
推荐指数
2
解决办法
2967
查看次数

JavaScript中的重入

我想提高我对reentrant一​​词的理解.

这个功能是可重入的吗?

function* foo() {
  yield 1;
  yield 2;
}
Run Code Online (Sandbox Code Playgroud)

还有这个?

function foo() {
  return 1;
}
Run Code Online (Sandbox Code Playgroud)

还有这个?

var x = 0;
function foo() {
  return x++;
}
Run Code Online (Sandbox Code Playgroud)

还有这个?

function foo() {
  setTimeout(foo, 1000);
}
Run Code Online (Sandbox Code Playgroud)

javascript reentrancy

10
推荐指数
1
解决办法
1526
查看次数

C,C++中重入代码的推荐实践

在编写可重入代码时,我正在阅读有关推荐实践的重新入门指南.

其他参考资料和资源涵盖了这个主题?

什么类似lint的工具可以用来检查这些问题?

c c++ reentrancy

7
推荐指数
1
解决办法
6576
查看次数

静态成员函数是可重入的吗?

正如标题所说:

如果我有一个带有静态成员函数的类,它本身不包含静态变量,我可以考虑该成员函数可重入吗?

c++ reentrancy

3
推荐指数
1
解决办法
2624
查看次数

什么是c中的重入函数?

我一直在寻找可重入函数的定义和使用.但是我无法理解其他网页中给出的定义.如果有人知道请解释一下吗?

c

2
推荐指数
3
解决办法
2万
查看次数

这个函数是可重入的吗?

void reverse_string(char* string, int str_size) {
    char tmp;
    int i = 0;
    int j = str_size - 1;
    while (i < j) {
        tmp = string[i];
        string[i] = string[j];
        string[j] = tmp;
        ++i;
        --j;
    }
}
Run Code Online (Sandbox Code Playgroud)

我认为这个函数是可重入的,因为它不使用任何全局变量.它只修改参数.

我的问题是:这个函数是可重入的吗?如果是的话,我的论点是否足够好?

提前致谢

c++ reentrancy

1
推荐指数
2
解决办法
2217
查看次数

C++:何时使用“new”,何时不使用?| 添加:不重复

我是 C++ 新手,想知道什么时候应该使用 new,什么时候不应该使用,例如“int x = 5”或“int * x = new int(5)”。我知道新在堆中保留内存,因此在块结束时不会被删除,但由于保存地址的变量将在块之外变得不可访问,我看不到任何好处。

例子:

if(x) {
 int * z = new int(5);
 // Do something
}
// At this point the 5 is saved somewhere but since z is unaccessible I can't use it.
Run Code Online (Sandbox Code Playgroud)

补充:这个问题没有重复,因为其他问题只解释了什么是堆,而没有描述它的好处。

c++ heap

1
推荐指数
1
解决办法
171
查看次数

标签 统计

reentrancy ×6

c++ ×4

c ×3

heap ×1

javascript ×1

parsing ×1

thread-safety ×1