首页   注册   登录
 juzipeek 最近的时间轴更新

juzipeek

V2EX 第 324468 号会员,加入于 2018-06-24 21:28:41 +08:00
Linux clone 疑问
Linux  •  juzipeek  •  79 天前  •  最后回复来自 juzipeek
7
juzipeek 最近回复了
79 天前
回复了 juzipeek 创建的主题 Linux Linux clone 疑问
补充说明,问题的语境是

```c
#define _GNU_SOURCE
#include <sched.h>

int clone(int (*fn)(void *), void *child_stack,
int flags, void *arg, ...
/* pid_t *ptid, void *newtls, pid_t *ctid */ );
```

... ...

The child_stack argument specifies the location of the stack used by the child process. Since the child and calling process may share memory, it is not possible for the child process to execute in the same stack as the calling process. The calling process must therefore set up memory space for the child stack and pass a pointer to this space to clone(). Stacks grow downward on all processors that run Linux (except the HP PA processors), so child_stack usually points to the topmost address of the memory space set up for the child stack.

... ...

现在觉的“ Since the child and calling process may share memory, it is not possible for the child process to execute in the same stack as the calling process. ”这句话没有营养,关键在后面,调用 clone 要指定 child_stack。
可以尝试下 understand (收费),kdevelop (免费)
2018-08-22 12:45:37 +08:00
回复了 xoxo419 创建的主题 程序员 下个月打算去杭州-云栖大会, 以前去过的朋友分享下
饭真的很贵,打车也不方便。有需要门票的可以私聊下
感觉是 nginx 配置有问题,可以贴下 nginx 配置文件
关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2563 人在线   最高记录 5043   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.3 · 11ms · UTC 10:47 · PVG 18:47 · LAX 03:47 · JFK 06:47
♥ Do have faith in what you're doing.