The Linux Programming Interface: a linux and unix system Programming Handbook
tải về
6.93 Mb.
Chế độ xem pdf
trang
43/806
Chuyển đổi dữ liệu
08.07.2022
Kích
6.93 Mb.
#52607
1
...
39
40
41
42
43
44
45
46
...
806
The Linux Programming Interface
63
ALTERNATIVE I/O MODELS
1325
63.1
Overview ............................................................................................................... 1325
63.1.1
Level-Triggered and Edge-Triggered Notification..................................... 1329
63.1.2
Employing Nonblocking I/O with Alternative I/O Models ....................... 1330
63.2
I/O Multiplexing ..................................................................................................... 1330
63.2.1
The
select()
System Call........................................................................ 1331
63.2.2
The
poll()
System Call ......................................................................... 1337
63.2.3
When Is a File Descriptor Ready? ......................................................... 1341
63.2.4
Comparison of
select()
and
poll()
.......................................................... 1344
63.2.5
Problems with
select()
and
poll()
............................................................ 1346
63.3
Signal-Driven I/O.................................................................................................... 1346
63.3.1
When Is “I/O Possible” Signaled? ........................................................ 1351
63.3.2
Refining the Use of Signal-Driven I/O.................................................... 1352
63.4
The
epoll
API........................................................................................................... 1355
63.4.1
Creating an
epoll
Instance:
epoll_create()
............................................... 1356
63.4.2
Modifying the
epoll
Interest List:
epoll_ctl()
............................................. 1356
63.4.3
Waiting for Events:
epoll_wait()
............................................................ 1358
63.4.4
A Closer Look at
epoll
Semantics .......................................................... 1363
63.4.5
Performance of
epoll
Versus I/O Multiplexing......................................... 1365
63.4.6
Edge-Triggered Notification ................................................................. 1366
63.5
Waiting on Signals and File Descriptors..................................................................... 1368
63.5.1
The
pselect()
System Call ...................................................................... 1369
63.5.2
The Self-Pipe Trick ............................................................................... 1370
63.6
Summary................................................................................................................ 1373
63.7
Exercises ................................................................................................................ 1374
Contents
in Detail
tải về
6.93 Mb.
Chia sẻ với bạn bè của bạn:
1
...
39
40
41
42
43
44
45
46
...
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
BÁO CÁO
Tài liệu