Book description
UNIX Systems Programming: Communication, Concurrency, and
Threadsby Kay A. Robbins and Steven Robbins
UNIX processes, files, and special files
Signals and timers
POSIX threads, semaphores, and IPC
TCP, UDP, multicast, and the Web
Features projects on Internet radio, server performance, timers, web caching, and shells
Learn how to design and implement reliable UNIX software whether
you are using Linux, Solaris, Mac OS X, or another POSIX-based
system.
This completely updated classic (originally titled Practical
UNIX Programming) demonstrates how to design complex software
to get the most from the UNIX operating system. UNIX Systems
Programming provides a clear and easy-to-understand introduction to
the essentials of UNIX programming. Starting with short code
snippets that illustrate how to use system calls, Robbins and
Robbins move quickly to hands-on projects that help readers expand
their skill levels.
This practical guide thoroughly explores communication, concurrency,and multithreading. Known for its comprehensive and lucid explanationsof complicated topics such as signals and concurrency, the bookfeatures practical examples, exercises, reusable code, and simplifiedlibraries for use in network communication applications.
A self-contained reference that relies on the latest UNIX standards,UNIX Systems Programming provides thorough coverage of files, signals,semaphores, POSIX threads, and client-server communication. Thisedition features all-new chapters on the Web, UDP, and serverperformance. The sample material has been tested extensively in theclassroom.
PRENTICE HALL
Professional Technical Reference
Upper Saddle River, NJ 07458
www.phptr.com
ISBN: 0-13-042411-0
Table of contents
- Copyright
- About the Web Site
- Preface
-
I. Fundamentals
- 1. Technology’s Impact on Programs
-
2. Programs, Processes and Threads
- 2.1. How a Program Becomes a Process
- 2.2. Threads and Thread of Execution
- 2.3. Layout of a Program Image
- 2.4. Library Function Calls
- 2.5. Function Return Values and Errors
- 2.6. Argument Arrays
- 2.7. Thread-Safe Functions
- 2.8. Use of Static Variables
- 2.9. Structure of Static Objects
- 2.10. Process Environment
- 2.11. Process Termination
- 2.12. Exercise: An env Utility
- 2.13. Exercise: Message Logging
- 2.14. Additional Reading
- 3. Processes in UNIX
- 4. UNIX I/O
- 5. Files and Directories
- 6. UNIX Special Files
-
7. Project: The Token Ring
- 7.1. Ring Topology
- 7.2. Ring Formation
- 7.3. Ring Exploration
- 7.4. Simple Communication
- 7.5. Mutual Exclusion with Tokens
- 7.6. Mutual Exclusion by Voting
- 7.7. Leader Election on an Anonymous Ring
- 7.8. Token Ring for Communication
- 7.9. Pipelined Preprocessor
- 7.10. Parallel Ring Algorithms
- 7.11. Flexible Ring
- 7.12. Additional Reading
-
II. Asynchronous Events
-
8. Signals
- 8.1. Basic Signal Concepts
- 8.2. Generating Signals
- 8.3. Manipulating Signal Masks and Signal Sets
- 8.4. Catching and Ignoring Signals—sigaction
- 8.5. Waiting for Signals—pause, sigsuspend and sigwait
- 8.6. Handling Signals: Errors and Async-signal Safety
- 8.7. Program Control with siglongjmp and sigsetjmp
- 8.8. Programming with Asynchronous I/O
- 8.9. Exercise: Dumping Statistics
- 8.10. Exercise: Spooling a Slow Device
- 8.11. Additional Reading
- 9. Times and Timers
- 10. Project: Virtual Timers
- 11. Project: Cracking Shells
-
8. Signals
-
III. Concurrency
- 12. POSIX Threads
-
13. Thread Synchronization
- 13.1. POSIX Synchronization Functions
- 13.2. Mutex Locks
- 13.3. At-Most-Once and At-Least-Once-Execution
- 13.4. Condition Variables
- 13.5. Signal Handling and Threads
- 13.6. Readers and Writers
- 13.7. A strerror_r Implementation
- 13.8. Deadlocks and Other Pesky Problems
- 13.9. Exercise: Multiple Barriers
- 13.10. Additional Reading
- 14. Critical Sections and Semaphores
-
15. POSIX IPC
- 15.1. POSIX:XSI Interprocess Communication
- 15.2. POSIX:XSI Semaphore Sets
- 15.3. POSIX:XSI Shared Memory
- 15.4. POSIX:XSI Message Queues
- 15.5. Exercise: POSIX Unnamed Semaphores
- 15.6. Exercise: POSIX Named Semaphores
- 15.7. Exercise: Implementing Pipes with Shared Memory
- 15.8. Exercise: Implementing Pipes with Message Queues
- 15.9. Additional Reading
-
16. Project: Producer Consumer Synchronization
- 16.1. The Producer-Consumer Problem
- 16.2. Bounded Buffer Protected by Mutex Locks
- 16.3. Buffer Implementation with Semaphores
- 16.4. Introduction to a Simple Producer-Consumer Problem
- 16.5. Bounded Buffer Implementation Using Condition Variables
- 16.6. Buffers with Done Conditions
- 16.7. Parallel File Copy
- 16.8. Threaded Print Server
- 16.9. Additional Reading
-
17. Project: The Not Too Parallel Virtual Machine
- 17.1. PVM History, Terminology, and Architecture
- 17.2. The Not Too Parallel Virtual Machine
- 17.3. NTPVM Project Overview
- 17.4. I/O and Testing of Dispatcher
- 17.5. Single Task with No Input
- 17.6. Sequential Tasks
- 17.7. Concurrent Tasks
- 17.8. Packet Communication, Broadcast and Barriers
- 17.9. Termination and Signals
- 17.10. Ordered Message Delivery
- 17.11. Additional Reading
-
IV. Communication
-
18. Connection-Oriented Communication
- 18.1. The Client-Server Model
- 18.2. Communication Channels
- 18.3. Connection-Oriented Server Strategies
- 18.4. Universal Internet Communication Interface (UICI)
- 18.5. UICI Implementations of Different Server Strategies
- 18.6. UICI Clients
- 18.7. Socket Implementation of UICI
- 18.8. Host Names and IP Addresses
- 18.9. Thread-Safe UICI
- 18.10. Exercise: Ping Server
- 18.11. Exercise: Transmission of Audio
- 18.12. Additional Reading
-
19. Project: WWW Redirection
- 19.1. The World Wide Web
- 19.2. Uniform Resource Locators (URLs)
- 19.3. HTTP Primer
- 19.4. Web Communication Patterns
- 19.5. Pass-through Monitoring of Single Connections
- 19.6. Tunnel Server Implementation
- 19.7. Server Driver for Testing
- 19.8. HTTP Header Parsing
- 19.9. Simple Proxy Server
- 19.10. Proxy Monitor
- 19.11. Proxy Cache
- 19.12. Gateways as Portals
- 19.13. Gateway for Load Balancing
- 19.14. Postmortem
- 19.15. Additional Reading
-
20. Connectionless Communication and Multicast
- 20.1. Introduction to Connectionless Communication
- 20.2. Simplified Interface for Connectionless Communication
- 20.3. Simple-Request Protocols
- 20.4. Request-Reply Protocols
- 20.5. Request-Reply with Timeouts and Retries
- 20.6. Request-Reply-Acknowledge Protocols
- 20.7. Implementation of UICI UDP
- 20.8. Comparison of UDP and TCP
- 20.9. Multicast
- 20.10. Exercise: UDP Port Server
- 20.11. Exercise: Stateless File Server
- 20.12. Additional Reading
-
21. Project: Internet Radio
- 21.1. Project Overview
- 21.2. Audio Device Simulation
- 21.3. UDP Implementation with One Program and One Receiver
- 21.4. UDP Implementation with Multiple Programs and Receivers
- 21.5. UDP Implementation of Radio Broadcasts
- 21.6. Multicast Implementation of Radio Broadcasts
- 21.7. TCP Implementation Differences
- 21.8. Receiving Streaming Audio Through a Browser
- 21.9. Additional Reading
-
22. Project: Server Performance
- 22.1. Server Performance Costs
- 22.2. Server Architectures
- 22.3. Project Overview
- 22.4. Single-Client Driver
- 22.5. Multiple-Client Driver
- 22.6. Thread-per-request and Process-per-request Implementations
- 22.7. Thread-worker-pool Strategy
- 22.8. Thread-worker Pool with Bounded Buffer
- 22.9. Process-worker Pool
- 22.10. Influence of Disk I/O
- 22.11. Performance Studies
- 22.12. Report Writing
- 22.13. Additional Reading
-
18. Connection-Oriented Communication
- Appendices
- Bibliography
Product information
- Title: Unix™ Systems Programming: Communication, Concurrency, and Threads
- Author(s):
- Release date: June 2003
- Publisher(s): Pearson
- ISBN: 0130424110
You might also like
book
Programming with POSIX ® Threads
With this practical book, you will attain a solid understanding of threads and will discover how …
book
Mastering Assembly Programming
Incorporate the assembly language routines in your high level language applications About This Book Understand the …
book
Practical System Programming with C: Pragmatic Example Applications in Linux and Unix-Based Operating Systems
This book teaches system programming with the latest versions of C through a set of practical …
book
C++ Common Knowledge: Essential Intermediate Programming
“We live in a time when, perhaps surprisingly, the best printed works on C++ are just …