Programming Multicore and Many-core Computing Systems (Wiley Series on Parallel and Distributed Computing) by Sabri Pllana & Fatos Xhafa
Author:Sabri Pllana & Fatos Xhafa
Language: eng
Format: mobi, azw3, pdf
ISBN: 9781119332008
Publisher: Wiley
Published: 2017-01-22T23:00:00+00:00
11.3 CONCURRENT CODE
The keyword for further parallelization, in particular of common work tasks that do not adhere to the typical parallel patterns mentioned earlier, is therefore ‘concurrency’. It also determines whether a loop or a pattern can be effectively executed in parallel in the first instance.
Concurrency in this specific context reflects the dependencies of a given code segment or function on other functions or parts of the code. The higher the degree of concurrency, that is, the less dependencies exist, the more effective is its parallel execution and the less likely delays occur due to synchronization overhead. In the ideal case, such as in embarrassingly parallel tasks, the concurrency reaches a maximum that implies that there are virtually no dependencies between the processes.
Obviously, a high degree of concurrency does not necessarily imply that the according segment can be executed in full parallel. A single shared variable can stall the full execution, if the seemingly concurrent code has to wait for the first thread to finish its calculation before the variable is free for access. At the same time, this obviously depends on the read–write order of the respective segments. Accordingly, and as discussed in more detail later, it is difficult to automatically identify concurrency in a given code efficiently. More realistic approaches, such as the Star Superscalar programming model, [7] therefore require the developer to explicitly annotate data dependencies across their code and functions. This information can then be exploited by the compiler to generate a dependency graph which provides implicit information about the execution order and potential points for parallelization and task distribution.
Star Superscalar is thereby still very coarse granular and expects specific function calls to exhibit concurrency rather than, for example, direct workload in a loop. It furthermore does not assess the execution speed of individual function blocks so that resources may not be used to their full optimum – nonetheless the model provides an easy method to increase the overall execution performance.
Essentially, even classical parallelization measurements base on the principle of maximizing concurrency between threads, so as to minimize dependencies and thus communication and synchronization overhead. Concurrency identification can therefore be regarded as the key factor in (semi-)automated parallelization and in addressing the requirements for future programming models. As indicated, however, concurrency cannot be reliably identified automatically.
11.3.1 Concurrency Analysis and Exploitation
There is an extensive literature on automated parallelization which deals with multiple aspects of concurrency analysis in order to identify dependencies. In general, the stronger such a dependency, the less parallelizable the according function. However this furthermore depends on the sequence of read–write statements in the code and on frequency of such occurrences. As a rule of thumb, the gain achieved through the concurrent execution must be higher than the loss introduced this way. While this may sound trivial, it has multiple implications.
The major performance loss occurs by latency introduced through any delays – the most obvious are (i) waiting for data to become available and (ii) passing it to the respective thread and returning results. Similarly, additional delay arises through access to shared-memory spaces.
Download
Programming Multicore and Many-core Computing Systems (Wiley Series on Parallel and Distributed Computing) by Sabri Pllana & Fatos Xhafa.azw3
Programming Multicore and Many-core Computing Systems (Wiley Series on Parallel and Distributed Computing) by Sabri Pllana & Fatos Xhafa.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven Development with Java by Alan Mellor(6709)
Data Augmentation with Python by Duc Haba(6617)
Principles of Data Fabric by Sonia Mezzetta(6372)
Learn Blender Simulations the Right Way by Stephen Pearson(6267)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6134)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5531)
Big Data Analysis with Python by Ivan Marin(5355)
The Infinite Retina by Robert Scoble Irena Cronin(5226)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5144)
Pretrain Vision and Large Language Models in Python by Emily Webber(4315)
Infrastructure as Code for Beginners by Russ McKendrick(4076)
Functional Programming in JavaScript by Mantyla Dan(4038)
The Age of Surveillance Capitalism by Shoshana Zuboff(3946)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3790)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3592)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3568)
