- 论坛徽章:
- 0
|
原帖由 pinyin 于 2007-8-14 18:00 发表
select方法和nanosleep方法都是sleep方法,这样的定时器能用吗?
不是吧
在SunOS下查的
man sleep:
In a single-threaded program (one not linked with -lthread
or -lpthread), the routine is implemented by setting an
alarm signal and pausing until it (or some other signal)
occurs. The previous state of the alarm signal is saved and |
关于nanosleep,网上搜到的:
vxd (napoo◆这个春天有点蓝) 于 (Wed Mar 10 14:58:31 2004) 提到:
如果是用nanosleep实现的,那应该不是利用信号了:
in kernel/timer.c:
asmlinkage long sys_nanosleep (...)
{
...
expire = schedule_timeout (...);
...
}
也就是说,nanosleep是用kernel timer实现的
|
|
|