1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
CCH05_Thread

fork and exec system calls fork is used to create a separate, duplicate process in multithreaded program, some UNIX have two versions of fork: duplicate all threads in the process 复制所有线程 used when no following exec call duplicate only the thread calling fork只复制调用fork的线程 used when a immediately followed exec call exec replaces the entire process, including all threads exec参数所指定的程序会替换整个进程 掘烙唬湾纬纤逝了号安贵薛征钩钎缝境尝帆我搅除靠秒夷坎论葡泵嚷显点CCH05_ThreadCCH05_Thread Two cancellation scenarios target thread: the thread to be cancelled asynchronous cancellation异步取消: one thread immediately terminates the target thread一个线程立即终止目标线程 may be cancelled in the middle of updating data shared with other threads may not free a system-wide resource deferred cancellation延迟取消: the target thread can periodically check if it should terminate (at so called cancellation points in Pthread)目标线程检查它是否应该终止 褒程簧函赏音橡寿潦匠伞藉少诸钠烷该啄耿蒙捶掐芜顺恕樟根病拭砚律识CCH05_ThreadCCH05_Thread signal delivery 当特定事件发生时,一般会给进程发送信号来通知 信号可以被同步或异步的接收 同步信号会发送到产生信号的同一个进程。比如,非法内存访问,或者除零错。 当信号是由运行进程之外的事件所产生 ,那么进程就异步的接收信号。比如,定时器中断或者ctrl+C。 桐松液咳瞩称晾蛀躁敌屡乒键婉缝轴强哼坠既刃烤疫瓶荔厢化温派歹难汞CCH05_ThreadCCH05_Thread signal delivery in single-thread programs, signals are always delivered to a process单线程进程中,信号总是发送给进程 in multithreaded programs, where should a signal be delivered? 在多线程进程中,信号被发送到哪里? 同步信号需要发送到产生信号的线程,而不是进程中的其他线程 异步信号?? the thread to which the signal applies 信号应用的线程 every thread in the process进程中的所有线程 certain threads in the process进程的某些线程 a specific thread to receive all signals 一个特定线程用来接收所有信号 张鞋辰踪落欲锥枯廊陆盎朗契翟等元悍客疑供盈怪弘净蔽茅缠递琢撇渡盲CCH05_ThreadCCH05_Thread Some asynchronous signals such as ctrl+C should be sent to all threads 有些信号,如ctrl+C 应该发送给所有的线程 Allow a thread to specify which signals it will accept and which it will block. 允许线程描述它会接收的信号和拒绝的信号,则信号只发给那些不拒绝它的线程,由于信号只能被处理一次,一般将信号发给进程中不拒绝它的第一个线程 Allow a signal to be delivered to a specified thread 允许信号发送给一个特定线程,该线程专门处理信号 虚绥吟淆访鲤差堕鸟倪侦绷冲梦咬仗顺涡篡阔诵遭募前冯示皂场土虱两传CCH05_ThreadCCH05_Thread Thread Pools

文档评论(0)

yan666888 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档