C COURSEWARE
Lecture notes + integrated exercises, solutions and marking
Contents
The Common Desktop Environment
C/C++ Program Compilation
C Basics
Conditionals
Looping and Iteration
Arrays and Strings
Functions
Further Data Types
Pointers
Dynamic Memory Allocation and Dynamic Structures
Advanced Pointer Topics
Low Level Operators and Bit Fields
The C Preprocessor
C, UNIX and Standard Libraries
Integer Functions, Random Number, String Conversion, Searching
and Sorting: <stdlib.h>
Mathematics: <math.h>
Input and Output (I/O):stdio.h
String Handling: <string.h>
File Access and Directory System Calls
Time Functions
Process Control: <stdlib.h>,<unistd.h>
Interprocess Communication (IPC), Pipes
IPC:Interrupts and Signals: <signal.h>
IPC:Message Queues:<sys/msg.h>
IPC:Semaphores
IPC:Shared Memory
IPC:Sockets
Threads: Basic Theory and Libraries
Processes and Threads
Thread Levels
Threads libraries
The POSIX Threads Library:libpthread, <pthread.h>
Creating a (Default) Thread
Wait for Thread Termination
A Simple Threads Example
Detaching a Thread
Create a Key for Thread-Specific Data
Delete the Thread-Specific Data Key
Set the Thread-Specific Data Key
Get the Thread-Specific Data Key
Global and Private Thread-Specific Data Example
Getting the Thread Identifiers
Comparing Thread IDs
Initializing Threads
Yield Thread Execution
Set the Thread Priority
Get the Thread Priority
Send a Signal to a Thread
Access the Signal Mask of the Calling Thread
Terminate a Thread
Solaris Threads: <thread.h>
Compiling a Multithreaded Application
Further Threads Programming:Thread Attributes (POSIX)
Further Threads Programming:Synchronization
Mutual Exclusion Locks
Condition Variable Attributes
Threads and Semaphores
Thread programming examples
Remote Procedure Calls (RPC)
Protocol Compiling and Lower Level RPC Programming
Writing Larger Programs
- Program Listings