The Linux Programming Interface: a linux and unix system Programming Handbook



tải về 6.93 Mb.
Chế độ xem pdf
trang19/806
Chuyển đổi dữ liệu08.07.2022
Kích6.93 Mb.
#52607
1   ...   15   16   17   18   19   20   21   22   ...   806
The Linux Programming Interface

23
TIMERS AND SLEEPING
 479
23.1
Interval Timers........................................................................................................... 479
23.2
Scheduling and Accuracy of Timers ............................................................................. 485
23.3
Setting Timeouts on Blocking Operations ...................................................................... 486
23.4
Suspending Execution for a Fixed Interval (Sleeping) ..................................................... 487
23.4.1
Low-Resolution Sleeping: 
sleep()
.............................................................. 487
23.4.2
High-Resolution Sleeping: 
nanosleep()
...................................................... 488
23.5
POSIX Clocks............................................................................................................ 491
23.5.1
Retrieving the Value of a Clock: 
clock_gettime()
........................................ 491
23.5.2
Setting the Value of a Clock: 
clock_settime()
............................................. 492
23.5.3
Obtaining the Clock ID of a Specific Process or Thread ............................. 493
23.5.4
Improved High-Resolution Sleeping: 
clock_nanosleep()
............................... 493
23.6
POSIX Interval Timers................................................................................................. 495
23.6.1
Creating a Timer: 
timer_create()
............................................................. 495
23.6.2
Arming and Disarming a Timer: 
timer_settime()
........................................ 498
23.6.3
Retrieving the Current Value of a Timer: 
timer_gettime()
............................. 499
23.6.4
Deleting a Timer: 
timer_delete()
.............................................................. 499
23.6.5
Notification via a Signal........................................................................ 499
23.6.6
Timer Overruns..................................................................................... 503
23.6.7
Notification via a Thread ....................................................................... 504
23.7
Timers That Notify via File Descriptors: the 
timerfd
API ................................................... 507
23.8
Summary.................................................................................................................. 511
23.9
Exercises .................................................................................................................. 512

tải về 6.93 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   15   16   17   18   19   20   21   22   ...   806




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương