Institute for Advanced Professional Studies
Linux Multithreaded Programming: Servers and Applications
Overview of Linux Multithreaded Programming:
Many applications juggle multiple chores at once. Server applications handle concurrent clients; interactive applications often deal with user input while processing background computations; computationally intensive applications harness the power of multiple processors. The common theme is the use of multiple threads of control to provide contexts for dealing with concurrent activities, whether multiplexed on one processor, executed in parallel on multiple processors, or taking advantage of the facilities of processors with Hyper-Threading Technology and new dual-core processors from AMD and Intel.
Coordinating the execution of such threads involves synchronizing access to shared data structures, insuring that programs are well behaved and deterministic regardless of the relative speeds of execution of their component threads. Multithreaded programs, like single-threaded programs, must deal with exceptions and interaction with the outside world. Though there may be many concurrent activities in such a program, the program as a whole should cleanly respond to such outside input.
There are a number of ways in which threads have been implemented, involving user-level libraries, the kernel, and various combinations. Most Linux implementations currently treat each thread as a separate process created using the clone system call (though each shares its address space with its cohorts); newer implementations of threads on Linux use different approaches; other versions of UNIX use still different approaches. We discuss them all, along with new features of POSIX threads. (Note that threads are sometimes known as lightweight processes, though this term takes on a particular, but related, technical meaning in Solaris.)
Linux Workshop Overview:
This hands-on course covers Linux multithreaded programming using the POSIX 1003.1c interface. A particular emphasis of the course is the design of high-performance servers. We address uniprocessors and multiprocessors, as well as Intel's hyper-threaded processors. We cover the use of POSIX Threads (also known as pthreads) not only in C programs, but also in C++ programs.
The course has two major themes: Writing reliable, maintainable programs and writing high-performing programs. An important sub theme of the course is determining when it is appropriate to use multithreaded programming techniques. Much of the course is spent learning and practicing how to write, test and enhance multithreaded programs, covering common pitfalls, and working with numerous examples.
50% of this course is devoted to guided, hands-on programming exercises, ensuring that participants gain sufficient experience with multithreaded program design, coding, error detection and debugging techniques. Among the areas emphasized in the course are the special concerns for programming multiprocessors, particularly techniques for taking maximum advantage of the available processors. Participants learn how threads packages are implemented so that they can understand the performance implications of the various approaches when writing multithreaded programs.
A major module focuses on the design of scalable servers. Included here are techniques for improving responsiveness to network requests and for reducing overhead in handling such requests.
IAPS can customize Linux training to achieve specific organizational objectives. We also offer multithreaded programming training for Windows (Win32), Solaris and UNIX (POSIX) for groups developing and supporting embedded real-time systems, as well as desktop, client and server applications on uniprocessor and multiprocessor platforms.
Linux Workshop Objectives:
Upon successful completion of this course, participants will be able to:
Experienced C and C++ programmers who wish to become competent at writing multithreaded programs, such as high-performing high-reliability servers, on Linux platforms
Participants should be experienced C and C++ programmers: They must be comfortable with all the major features of the languages, including pointers, dynamic storage allocation, classes, abstract types, and inheritance. They should have experience programming on Linux (or other UNIX systems) and should know how to use standard facilities to edit, compile, and debug applications.
© Copyright 1997-2015 Institute for Advanced Professional Studies (IAPS)