Multithreading Tutorial
© Mario Konrad 2003
Table of contents
1. Introduction
This is a serie of tutorials about multithreading.
It will start with basics (for beginners) and end with
more advanced topics.
The tutorials are not covering the basics of the
programming language C. It is assumed that you
have all necessary knowledge about the language.
All the tutorials are using gcc,
pthreads and some other GNU tools under Linux.
Most of the source code example are working with Cygwin as well.
2. Tutorials
All tutorials are copyrighted material.
2.1 Basic Tutorials
2.3 Advanced Tutorials
2.4 Building Programs
The tutorials explain the necessary steps to build and run the programs.
However sometimes a Makefile would be appropriate. If you don't like
to write your own, you may use this one:
It build for all tutorials provided here. Build them all by issuing the command
'make'. If you like to build a particular tutorial, simply enter:
'make tutorialX'.
3. Glossary
- Coroutine
- Concurrent running parts of a program without
separate contexts and without separate memory spaces. Handled
by the programmer.
- Mutex
- Abbreviation for the term mutual exclusion.
Mechanism to guarantee that only one thread at a time can
stay within a critical section of a program.
- Process
- Concurrent running programs with separate contexts
and memory spaces (protected against each other). Handled by the
scheduler.
- Thread
- Concurrent running parts of a program with separate
contexts but without separate memory spaces. Handled by the
scheduler. Several threads may be combined to thread groups. One
thread can only be in one thread group. Threads are always running
in a context of a process.
- SMP
- Symetrical Multi Processing. A system with
more than one CPU, which are able to communicate with
each other and all CPUs have equal access to all
devices.
4. Resources
|