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



tải về 6.93 Mb.
Chế độ xem pdf
trang38/806
Chuyển đổi dữ liệu08.07.2022
Kích6.93 Mb.
#52607
1   ...   34   35   36   37   38   39   40   41   ...   806
The Linux Programming Interface

54
POSIX SHARED MEMORY
 1107
54.1
Overview ............................................................................................................... 1108
54.2
Creating Shared Memory Objects ............................................................................. 1109
54.3
Using Shared Memory Objects ................................................................................. 1112
54.4
Removing Shared Memory Objects............................................................................ 1114
54.5
Comparisons Between Shared Memory APIs............................................................... 1115
54.6
Summary................................................................................................................ 1116
54.7
Exercise ................................................................................................................. 1116
55
FILE LOCKING
 1117
55.1
Overview ............................................................................................................... 1117
55.2
File Locking with 
flock()
............................................................................................ 1119
55.2.1
Semantics of Lock Inheritance and Release............................................. 1122
55.2.2
Limitations of 
flock()
............................................................................ 1123


xxvi
Contents in Detail
55.3
Record Locking with 
fcntl()
....................................................................................... 1124
55.3.1
Deadlock ........................................................................................... 1128
55.3.2
Example: An Interactive Locking Program............................................... 1129
55.3.3
Example: A Library of Locking Functions ................................................ 1133
55.3.4
Lock Limits and Performance................................................................. 1135
55.3.5
Semantics of Lock Inheritance and Release............................................. 1136
55.3.6
Lock Starvation and Priority of Queued Lock Requests.............................. 1137
55.4
Mandatory Locking.................................................................................................. 1137
55.5
The /proc/locks File ................................................................................................ 1140
55.6
Running Just One Instance of a Program..................................................................... 1142
55.7
Older Locking Techniques ........................................................................................ 1144
55.8
Summary................................................................................................................ 1146
55.9
Exercises ................................................................................................................ 1147

tải về 6.93 Mb.

Chia sẻ với bạn bè của bạn:
1   ...   34   35   36   37   38   39   40   41   ...   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