
SECOND EDITION

W.
RICHARD
STEVENS
you'll
ever
nee&
b
Interprocess
Communications
I
Well
-
implemented interprocess communications (IPC) are key to the performance of
virtually every non
-
trivial UNIX program. In
UNIX Network
Programming,
Udnme
2,
Seeond
Edition,
legendary UNIX expert W. Richard Stevens presents
a comprehensive guide to every form of
IPC. including message passing. synchronization.
shared memory, and Remote Procedure Calls (RPG.
-
Stevens heglns with a basic: introduction to IPC and the problems it is intended
to
solve
Slep
-
by
-
step you'll learn how to maximize both System
V
IPC and the new Posix standards.
which offer dramatic improvements in convenience and performance. You'll find extensive
coverage of Pthreads. with many examples rrflecting multiple threads instead of multiple
processes.
Alongthe way. you'll master every current IPC technique and technology. including:
Pipes and
FlFOs
POSIX and System
V
Semaphores
Posix and System
V
Message Queues Poslx and System
V
Shared Me
t
-C
Sbiaris Doors and Sun
RPC
performance Measurements
of
IPC
Techn~ques
of
UNlX Network
Programming,
1
of five! You won't just learn about IPC
"
from the outside.
"
You'll actually create implemkntatiom of Posix message queues.
read
-
write locks, and semaphores, gaining an in-de@h understanding
of
these
capabilities you simply can't get
awwhere else.
The book contains extensive new source code
-
-
all caqfully optimized and available
on the Web. You'll even find
a
complete guide
to
mesuring IPC performance
with message passing bandwidth and
laterfcy progrMns, and thread and process
synchronization programs.
The better you understand
IPC. the better your UNIX software will run. This book
contains all you need to know.
I
ABOUT THE AUTHOR
W.
RlCHAR
D
STEVENS
is author of
UNIX
Network Programming. Firs
widely recognized
as
the classic text in UNIX networking and
UNIX
Net
Programming,
Wume
1.
Second Edition.
He is also author of
Advanced
in the
UNIX
Environment
and the
TCP/IP IIIustrated
Series. Stevens
is an acknowledged UNIX and networking expert. sought
-
after
instructor, and
occamnal consultant.
PRENTICE HALL
Upper Saddle River.
NJ
07458

Function prototype Page
boolLt clnt-control (CLIENT
*d,
unsigned int
request,
char
*ptr)
;
418
CLIENT *clnt-create (const char
*host,
unsigned long
prognum,
unsigned long
versnum,
const char
*protocol)
;
void clnt-destroy(CL1ENT
*c!);
420
int door
-
bind
(
int
fd)
;
390
int door
-
call
(
int
fd,
door-arg-t
*argp)
;
361
int door
-
create (Door
-
serverqroc
*proc,
void
*cookie,
u-int
attr)
;
363
int door
-
cred (door-cred-t
*cred)
;
365
int door
-
info (int
fd,
door-in£ o-t
*info)
;
365
int dooryeturn (char
*dataptr,
size
-
t
datasize,
door-desc-t
*descptr.
size
-
t
ndesc)
;
365
int door
-
revoke (int
fd)
;
390
Door
-
createqroc
*door~server~create(Door~createqroc
*prOc);
384
int door-unbind(void);
390
void err-durn (const char
*fit,
. .
.
)
;
void err
-
msg (const char
*fit,
. .
.
)
;
void err-quit (const char
*fit,
.
. .
)
;
void err-rot (const char
*fit,
. .
.
)
;
void err
-
sys (const char
*fit,
.
.
.
)
;
int fcntl (int
fd,
int
cmd,
. . .
/*
struct flock
*arg
*/
)
;
int fstat(int
fd,
struct stat
*buf
);
key
-
t ftok(const char
*pathname,
int
id);
int ftruncate (int
fd,
of f-t
length)
;
int qclose (mqd-t
mqdes)
;
int qgetattr (mqd-t
mqdes,
struct mpattr
*attr)
;
int -notify (mqd-t
mqdes,
const struct sigevent
*notification)
;
mqd-t qopen(const char
*name,
int
oflag,
. .
.
/*
mode
-
t
mode,
struct mq-attr
*attr
*/
).
int -unlink (const char
*name)
;
77
int msgctl(int
msqid,
int
cmd,
struct msqid-ds
*buff);
int msgget (key
-
t
key,
int
oflag)
;
FILE *popen (const char
*command,
const char
*type)
;
52

Function prototype Page
int pthread-cancel (pthread-t
tid)
;
187
void pthread-c leanupgop
(
int
execute)
;
187
void
pthread-cleanupgush(void
(*function)
(void
*)
,
void
*a%)
;
187
int pthreahcreate (pthread
-
t
*tid,
const pthread-attr-t
*attr,
void
*
(*fu?tc)
(void
*)
,
void
*a%)
;
502
int pthread-detach (pthread-t
tid)
;
504
void pthread-exit (void
*status)
;
504
int pthread-join(pthread-t
tid,
void
**status)
;
503
pthread-t pthread-self(void);
503
int
pthread-condattr-destroy(pthread-condattr-t
*attr);
172
int
pthread-condattr-getpshared(const
pthread
-
condattr
-
t
'attr,
int
*valptr)
;
173
int
pthread-condattr-init(pthread-condattr-t
*attr);
172
int
pthread-condattr-setpshared(pthread-condattr-t
*attr,
int
value);
173
int
pthread-cond-broadcast(pthread-cond-t
*cptr);
171
int
pthreahcond-destroy(pthread-cond-t
*cptr);
172
int
pthread-cond-init(pthread-cond-t
*cptr,
const pthread-condattr-t
*attr);
172
int
pthread-cond-signal(pthread-cond-t
*cptr);
167
int
pthread-cond-timedwait(pthread-cond-t
*cptr,
pthread-mutex-t
*mptr,
const struct timespec
*abstime)
;
171
int
pthread-cond-wait(pthread~cond-t
*cptr,
pthread-mutex-t
*mptr);
167
int
int
int
int
int
int
int
int
int
pthread-mutaxattr-destroy(pthread-mutexattr-t
*attr);
pthread-mutaxattr-getpsharrd
(
const pthread
-
mutexattr
-
t
*attr,
int
"valptr)
;
pthread-mutaxattr-init (pthread
-
mutexattr
-
t
*attr)
;
pthread-mutaxattr-setpshared(pthread-mutexattr-t
*attr,
int
value);
pthread-mutex-destroy(pthread-mutex-t
*mptr);
pthread-mutex-init(pthread-mutex-t
*mptr,
const pthread
-
mutexattr
-
t
*attr);
pthread~mutex~lock(pthread~mutex~t
*mptr)
;
pthrea~mutex~trylock(pthread~mutex~t
*mptr);
pthread~mutex~unlock(pthread~mutex~t
*mptr);
int
int
int
int
int
int
int
int
int
int
int
pthread~rwlockattr~destroy(pthread~rwlockattr~t
*attr);
pthread-rwlockattr-getpshared(const
pthread
-
rwlockattr
-
t
*attr,
int
*Va!ptr)
;
pthread-rwlockattr-init(pthread-rwlockattr-t
*attr);
pthread-rwlockattr-setpshared
(pthread
-
rwlockattr
-
t
*attr,
int
value)
;
pthread-rwlock_destroy(pthread-rwlock-t
*noptr);
pthread-rwlock-init (pthread-rwlock-t
*noptr,
const pthread
-
rwlockattr
-
t
*attr);
pthread~rwlock~rdlock(pthread~rwlock~t
*noptr);
pthread~rwlock~tryrdlock(pthread~rwlock~t
*noptr);
pthread~rwlock~trywr1ock(pthread~rwlock~t
*noptr);
pthrea~rwlock~unlock(pthread~rwlock~t
*nu@');
pthread~rw1ock~wrlock(pthread~rwlo~k~t
*qtr);

UNIX Network Programming
Volume
2
Second Edition
lnterprocess Communications
by
W.
Richard Stevens
ISBN
0-23-082082-9
Prentice
Hall
PTR
Upper Saddle River,
NJ
07458
www.phptr.com
- 1
- 2
- 3
前往页