ADVANCED UNIX PROGRAMMING
Course Description
In-depth training for software developers on UNIX system programming facilities. Learn how to develop sophisticated multiprocess applications using system calls and library routines.
4 days
Contact us for pricing
Prerequisites
Fundamentals of UNIX, C Programming, and Advanced C Programming. Strong C programming skills are required for this course.Audience
Application developers who will be writing advanced programs on UNIX.UNIX STANDARDS
Brief History of UNIXAT&T and Berkeley UNIX Systems
Major Vendors
What is a Standard?
What is POSIX?
Other Industry Specs and Standards
Library vs. System-Level Functions
FILES AND DIRECTORIES
Basic File TypesFile Descriptors
The open() and creat() Functions
Keeping Track of Open Files
File Table Entries
The v-node Structure
The fcntl Function
The fcntl() Function with F_DUPFD Command
File Attributes
The access() Function
link(), unlink(), remove(), and rename() Functions
Functions to Create, Remove, and Read Directories
SYSTEM I/O
Standard I/O vs System I/OSystem I/O Calls
File and Record Locking
PROCESSES
What is a Process?Process Creation and Termination
Process Memory Layout
Dynamic Memory Allocation
Accessing Environment Variables
Real and Effective User IDs
PROCESS MANAGEMENT
The Difference Between Programs and ProcessesThe fork() System Function
Parent and Child
The exec System Function
Current Image and New Image
The wait() and waitpid() Function
Interpreter files and exec
BASIC INTERPROCESS COMMUNICATION: PIPES
Interprocess CommunicationPipes
FIFOs
SIGNALS
What is a Signal?Types of Signals
Signal Action
Blocking Signals from Delivery
The sigaction() Function
Signal Sets and Operations
Sending a Signal to Another Process
Blocking Signals with sigprocmask()
Scheduling and Waiting for Signals
Restarting System Calls (SVR4)
Signals and Reentrancy
INTRODUCTION TO PTHREADS
Processes and ThreadsCreating Threads
Multitasking
Overview of Thread Architectures
Processes Versus Threads
The Pthreads API
Thread Termination
Joining Threads
Detaching Threads
Passing Arguments to Threads
PTHREADS SYNCHRONIZATION
The Sharing ProblemMutexes
Creating and Initializing Mutexes
Using Mutexes
Additional Synchronization Requirement
Using Condition Variables
OVERVIEW OF CLIENT/SERVER PROGRAMMING
Designing Applications for a Distributed EnvironmentClients and Servers
Ports and Services
Connectionless vs. Connection-Oriented Servers
Stateless vs. Stateful Servers
Concurrency Issues
THE BERKELEY SOCKETS API
Berkeley SocketsData Structures of the Sockets API
Socket System Calls
Socket Utility Functions
TCP CLIENT DESIGN
Algorithms Instead of DetailsClient Architecture
Generic Client/Server Model - TCP
The TCP Client Algorithm
TCP SERVER DESIGN
General ConceptsIterative Servers
Concurrent Servers
Performance Consideration
An Iterative Server Design
A Concurrent Server Design
SYSTEM V INTERPROCESS COMMUNICATION
System V IPCElements Common to msg, shm, and sem Facilities
The Three System V IPC Facilities
IPC via Message Queues
IPC via Shared Memory
Coordinating the Use of Shared Memory Segments
Semaphore Sets - emget()
Semaphore Sets - semctl()
Semaphore Sets - the semop() calls
Shared Memory Coordination Using Semaphores
Commands for IPC Facility Handling - ipcs and ipcrm
APPENDIX A: DATE AND TIME FUNCTIONS
OverviewTime Representations
Decoding Calendar Time
Shorthand Functions - asctime(), ctime()
Formatting Date and Time Strings
Process Times
The Difference Between clock() and times()
Berkeley High Resolution Timers
APPENDIX B: STANDARD I/O
Standard I/O Calls to manipulate streamsStandard I/O Calls which perform character I/O
Standard I/O Calls which perform string I/O
Standard I/O Calls Which Perform Formatted I/O
Standard I/O Calls Which Perform Binary I/O
UnixUnix AdministrationUnix ScriptingUnix Shell Scripting