Chapter 10

Concurrency Abstractions

Abstract

This chapter introduces a number of concurrency abstraction layers that provide the software developer some necessary abstractions for developing multicore software. Each of these abstraction layers has a technique for developing software using the approach, so several code examples are given for each approach. Pros and cons are discussed for each approach.

Keywords

Concurrency; abstraction; OpenCL; OpenMP; MPI; libraries; languages; frameworks; MCAPI

Writing code for multicore can be tedious and time-consuming. Here is an example. Below is the sequential code for a simple Dot Product:

#define SIZE 1000

Main() {

 double a[SIZE], b[SIZE];

 // Compute a and b

 double sum = 0.0;

 for(int i=0, i < SIZE; ...

Get Multicore Software Development Techniques now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.