Objectives
The purpose of this training is to provide a pedagogical presentation of C-C++ shared memory multicore application programming. These programming lan- guages provide access to a substantial number of multithreading programming environments and libraries, like the native threads libraries (Pthreads in Linux- Unix, Windows threads) or basic, general purpose libraries like Boost, and high level programming environments like OpenMP or the Intel Threading Building Blocks environment. While the emphasis is put in OpenMP as a widely adopted standard, a broader vision of multithreading is useful to develop a clear vision of the strategic options open to developers.
The pedagogical objectives of this training are:
• To provide a unified presentation of the basic concepts of multithreading and shared memory programming, underlining the universality of these concepts and discussing the way in which they are declined in different programming environments.
The purpose of this training is to provide a pedagogical presentation of C-C++ shared memory multicore application programming. These programming lan- guages provide access to a substantial number of multithreading programming environments and libraries, like the native threads libraries (Pthreads in Linux- Unix, Windows threads) or basic, general purpose libraries like Boost, and high level programming environments like OpenMP or the Intel Threading Building Blocks environment. While the emphasis is put in OpenMP as a widely adopted standard, a broader vision of multithreading is useful to develop a clear vision of the strategic options open to developers.
The pedagogical objectives of this training are:
• To provide a unified presentation of the basic concepts of multithreading and shared memory programming, underlining the universality of these concepts and discussing the way in which they are declined in different programming environments.
• To assess the focus, the strengths and the eventual weaknesses of the different programming environment, insisting on their complementarity as well as on their interoperability. Examples are given on the usage of Pthreads based tools in an OpenMP environment, in order to cope with parallel contexts that are not easily handled in OpenMP.
• To enhance programmer’s insights on threads, not multithreading lan- guages, by focusing on parallel and concurrent patterns that occur in real applications, and by discussing useful tricks, potential pitfalls and best practices that are largely independent of the underlying programming en- vironment.
Content
• Introduction to multithreading, overview of present hardaware and soft- ware technologies
• Introducing threads, the relevance of multithreading
• Creating and managing threads
• Thread safe programming
• Concurrent access to shared data: the need of mutual exclusion
• Event synchronization of threads
• Memory coherence and memory consistency issues. The role of memory consistency models.
• Pthread based library of high level synchronization tools.
• Thread pools as high level thread management utilities. Task centric programming versus thread centric programming.
• Complete overview of OpenMP, including all the new features of the latest
4.0 release. In depth discussion of task centric programming in OpenMP.
• Full OpenMP examples in data parallel codes, and in pipelining threads.
• Coments on the impact and relevance of the Intel Threading Building
Blocks (TBB) library.
Each one of this subjects is illustrated with an important number of ad hoc examples exhibiting pitfalls and best practices. A library of high level utilities that simplify the programming of delicate concurrency patterns (like control parallelism and pipelines, or point to point synchronizations among individual threads) developped by the author, is made available. Several real complete applications involving a substantial number of delicate programming issues are discussed in detail.
Prerequisites
Experience in C programming and some limited knowledge of C++. Experience in advanced C++ programing is not required. Except for the TBB part, only very basic C++ constructs (using objects, simple generic programming)are used, needed to access C++ libraries.
Trainer
Victor Alessandrini
Maison de la Simulation