博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
advacing lnux program --thread[copy]
阅读量:5881 次
发布时间:2019-06-19

本文共 1034 字,大约阅读时间需要 3 分钟。

We’ve seen how a program can fork a child process.The child process is initially

running its parent’s program, with its parent’s virtual memory, file descriptors, and so
on copied.The child process can modify its memory, close file descriptors, and the like
without affecting its parent, and vice versa.When a program creates another thread,
though, nothing is copied.The creating and the created thread share the same memory
space, file descriptors, and other system resources as the original. If one thread changes
the value of a variable, for instance, the other thread subsequently will see the modi-fied

value. Similarly, if one thread closes a file descriptor, other threads may not read

from or write to that file descriptor. Because a process and all its threads can be exe-cuting only one program at a time, if any thread inside a process calls one of the exec

functions, all the other threads are ended (the new program may, of course, create new
threads).

转载于:https://www.cnblogs.com/michile/archive/2013/02/03/2890568.html

你可能感兴趣的文章
QStandardItem and QStandardItemModel Class Reference
查看>>
我的友情链接
查看>>
使用Nginx搭建WEB服务器
查看>>
【oracle唯一主键SYS_GUID()】
查看>>
作业2
查看>>
raid技术-研究感受
查看>>
远程主机探测技术FAQ集 - 扫描篇
查看>>
C++中调用python函数
查看>>
Nomad添加acl认证
查看>>
“TI门外汉”网路知识笔记一 OSI参考模型
查看>>
你不需要jQuery(五)
查看>>
DatanodeDescriptor说明
查看>>
ServlertContext
查看>>
eclipse编辑器生命周期事件监听
查看>>
Python WOL/WakeOnLan/网络唤醒数据包发送工具
查看>>
sizeof(long)
查看>>
pxe网络启动和GHOST网克
查看>>
2.5-saltstack配置apache
查看>>
django数据库中的时间格式与页面渲染出来的时间格式不一致的处理
查看>>
Python学习笔记
查看>>