- 论坛徽章:
- 1
|
原帖由 kouu 于 2009-8-13 23:29 发表
难道放在栈上的数据也要加个锁?
APUE2:
A thread consists of the information necessary to represent an execution context within a process. This includes a thread ID that identifies the thread within a process, a set of register values, a stack, a scheduling priority and policy, a signal mask, an errno variable, and thread-specific data. Everything within a process is sharable among the threads in a process, including the text of the executable program, the program's global and heap memory, the stacks, and the file descriptors.
========================
这个得看访问的是什么吧,要是函数内部创建的局部变量就不需要了吧,属于线程stack,但要是通过指针访问进程stack中的一些信息,这就应该需要同步一下了 |
|