文件名称:sleep
- 所属分类:
- Linux/Unix编程
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 41kb
- 下载次数:
- 0次
- 提 供 者:
- cs07****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
sleep函数的完整实现
1. 实验要求:
1、使用alarm函数实现定时。
2、必须正确处理mysleep函数中的闹钟与调用者可能设置的闹钟之间的关系。例如,如何解决不同的信号处理函数的保存和恢复?如何处理调用者设置的闹钟比mysleep函数中的闹钟早响的问题?如何处理调用进程屏蔽SIGALRM信号?
3、不允许出现任何竟态条件(时间窗口)。
4、总之,mysleep的实现细节应当对调用者透明,也就是说,不论在实现mysleep函数时是否使用了alarm函数,对调用者是否以及如何使用alarm函数均不应有任何影响。
-The sleep function of the complete implementation of an experimental requirements: one, use the alarm function to achieve timing. 2 we must correctly handle the relationship between in the mysleep function alarm clock with caller may set the alarm clock. For example, how to solve different signal processing functions to save and restore? How to deal with the caller to set the alarm clock mysleep function of the alarm clock early as loud? How to deal with the calling process to shield the SIGALRM signal? 3, are not allowed in any race condition (time window). In short, the mysleep the implementation details should be transparent to the caller, that is, regardless of when the the realization mysleep function whether to use the alarm function, the caller whether and how to use the alarm function should not have any impact.
1. 实验要求:
1、使用alarm函数实现定时。
2、必须正确处理mysleep函数中的闹钟与调用者可能设置的闹钟之间的关系。例如,如何解决不同的信号处理函数的保存和恢复?如何处理调用者设置的闹钟比mysleep函数中的闹钟早响的问题?如何处理调用进程屏蔽SIGALRM信号?
3、不允许出现任何竟态条件(时间窗口)。
4、总之,mysleep的实现细节应当对调用者透明,也就是说,不论在实现mysleep函数时是否使用了alarm函数,对调用者是否以及如何使用alarm函数均不应有任何影响。
-The sleep function of the complete implementation of an experimental requirements: one, use the alarm function to achieve timing. 2 we must correctly handle the relationship between in the mysleep function alarm clock with caller may set the alarm clock. For example, how to solve different signal processing functions to save and restore? How to deal with the caller to set the alarm clock mysleep function of the alarm clock early as loud? How to deal with the calling process to shield the SIGALRM signal? 3, are not allowed in any race condition (time window). In short, the mysleep the implementation details should be transparent to the caller, that is, regardless of when the the realization mysleep function whether to use the alarm function, the caller whether and how to use the alarm function should not have any impact.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
signal.c
testsleep.c
5实现mysleep函数.doc
mysleep.c
result
testsleep.c
5实现mysleep函数.doc
mysleep.c
result