Concurrency

How Rust makes Rayon’s data parallelism magical

How Rust makes Rayon’s data parallelism magical

Rayon is a data parallelism library for the Rust programming language. Common reactions from programmers who start to use Rayon express how it seems magical: “I changed one line and my code now runs in parallel!” As one of Rayon’s authors, I am of course glad to see happy users, but I want to dispel some of the magic and give credit where it’s due—to Rust itself.

Continue reading How Rust makes Rayon’s data parallelism magical

Share
Red Hat build of Eclipse Vert.x 3.9 brings Fluent API Query

Red Hat build of Eclipse Vert.x 3.9 brings Fluent API Query

Red Hat Runtimes provides a set of comprehensive frameworks, runtimes, and programming languages for developers, architects, and IT leaders with cloud-native application development needs. The latest update to Red Hat Runtimes has arrived with Red Hat’s build of Eclipse Vert.x version 3.9. Red Hat Runtimes provides application developers with a variety of application runtimes and lets them run on the Red Hat OpenShift Container Platform.

A fluent API is a common pattern throughout Vert.x, it lets multiple methods calls be chained together. For example:

request.response().putHeader("Content-Type", "text/plain").write("some text").end();

Chaining calls like this also allows you to write code that’s a bit less verbose.

With 3.9, you can now create prepared statements and collector queries with the inclusion of Query in the Fluent API. If you are familiar with JDBC, PreparedStatement lets you create and execute statements. Moreover, you can run multiple interactions, such as cursor or stream operations.

Continue reading “Red Hat build of Eclipse Vert.x 3.9 brings Fluent API Query”

Share
March 2018 ISO C++ Meeting Trip Report (SG1: Concurrency and Parallelism)

March 2018 ISO C++ Meeting Trip Report (SG1: Concurrency and Parallelism)

This year’s Winter ISO C++ Standard Committee meeting was held in March in Jacksonville, Florida. A number of larger features, for which there is substantial interest but which are also difficult to get right, were discussed:

  • Concepts, along with Concept types from the Ranges TS; see P0898 and n4685
  • Modules; see n4689
  • Coroutines; see n4723
  • Networking; see n4711
  • Executors; see p0443

Jason Merrill’s recently published trip report covers the core language topics. This report focuses on the topics of interest to the Concurrency and Parallelism Study Group (SG1).  The “big ticket” items discussed in SG1 during the week were:

Continue reading “March 2018 ISO C++ Meeting Trip Report (SG1: Concurrency and Parallelism)”

Share

Red Hat at the ISO C++ Standards Meeting (June 2016, Oulu): Parallelism and Concurrency

Several Red Hat engineers recently attended the JTC1/SC22/WG21 C++ Standards Committee meetings in Oulu, Finland.  This post focuses on the sessions of SG1 (the standards committee sub-group 1 – for concurrency and parallelism) as well as on coroutines-related sessions. Jason already gave an overview of the meeting in his post.

SG1 prioritized proposals and issues affecting the (expected) C++17 standard, followed by proposals targeting the Concurrency TS or a future revision of the Parallelism TS.  We also made some progress in the space of coroutines.

Continue reading “Red Hat at the ISO C++ Standards Meeting (June 2016, Oulu): Parallelism and Concurrency”

Share

Red Hat at the ISO C++ Standards Meeting (March 2016): Parallelism, Concurrency, and Coroutines

Several Red Hat engineers recently attended the JTC1/SC22/WG21 C++ Standards Committee meetings in March 2016 in Jacksonville, Florida, USA.  This post focuses on the sessions of SG1 (the standards committee sub-group 1 – for concurrency and parallelism) and on several proposals related to coroutines.

The biggest news from a parallelism and concurrency (P&C) perspective is that the Parallelism Technical Specification v1 was voted into the working draft of the standard.

This means that C++17 will offer support for several parallel algorithms, provided that the standard is approved in the remaining stages of the ISO voting process. If approved, this will make utilizing parallelism easier for many users – e.g., a parallel “for-each” loop, as a simple example.

Several proposals for support of vector execution are also progressing, and I believe that they might be ready before version 2 of the Parallelism Technical Specification is published.

Continue reading “Red Hat at the ISO C++ Standards Meeting (March 2016): Parallelism, Concurrency, and Coroutines”

Share
Red Hat at the ISO C++ Standards Meeting (May 2015): Parallelism and Concurrency

Red Hat at the ISO C++ Standards Meeting (May 2015): Parallelism and Concurrency

gnu logoSeveral Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in May 2015 at Lenexa, Kansas, USA.  This post focuses on the sessions of SG1, the study group on parallelism and concurrency.

Finishing the Technical Specifications (TSes) was one major point on the agenda of SG1. The Parallelism TS (see this draft) and the Transactional Memory TS (see this draft) have been finalized for publication, and the Concurrency TS and has been made ready for a vote and feedback by the National Bodies. GCC does not yet support those TSes but already has the main functionality required by the Transactional Memory TS through implementing a previous specification of the language constructs for transactions. SG1 is continuing to adding features in those areas, but these will target a version 2 of each of these TSes.

Continue reading “Red Hat at the ISO C++ Standards Meeting (May 2015): Parallelism and Concurrency”

Share

Recent improvements to concurrent code in glibc

gnu logoIn this post, I will give examples of recent improvements to concurrent code in glibc, the GNU C library, in the upstream community project. In other words, this is code that can be executed by multiple threads at the same time and has to coordinate accesses to shared data using synchronization. While some of these improvements are user-visible, many of them are not but can serve as examples of how concurrent code in other code bases can be improved.

One of the user-visible improvements is a new implementation of Pthreads semaphores that I contributed. It puts less requirements on when a semaphore can be destructed by a program. Previously, programs had to wait for all calls to sem_wait or sem_post to return before they were allowed to call sem_destroy; now, under certain conditions, a thread that returned from sem_wait can call sem_destroy immediately even though the matching sem_post call has woken this thread but not returned yet. This works if, for example, the semaphore is effectively a reference counter for itself; specifically, the program must still ensure that there are no other concurrent, in-flight sem_wait calls or sem_post calls that are yet to increment the semaphore. The new semaphore implementation is portable code due to being based on C11 atomic operations (see below) and replaces several architecture-specific implementations.

Continue reading “Recent improvements to concurrent code in glibc”

Share
Red Hat at the ISO C++ Standards Meeting (Nov 2014): Parallelism and Concurrency

Red Hat at the ISO C++ Standards Meeting (Nov 2014): Parallelism and Concurrency

gnu logoSeveral Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in November 2014 at Urbana-Champaign, IL, USA.  This post focuses on the sessions of SG1, the study group on parallelism and concurrency, which met for the whole week to discuss proposals and work on the technical specifications (TS) for both parallelism and concurrency.

SG1 mostly worked on finalizing the first revision of the Parallelism TS, and continued working on accepting proposals into the Concurrency TS. The Transactional Memory proposal is also making progress on becoming a TS.

Continue reading “Red Hat at the ISO C++ Standards Meeting (Nov 2014): Parallelism and Concurrency”

Share

Intelⓡ Threading Building Blocks in Red Hat Enterprise Linux 7

That the “free lunch is over” may have become something of a cliche in the IT industry, but the fact is that lately, the increase in cycles per second has been mostly realized by adding more processing units rather than by other techniques. While multiprocessor mainframes and supercomputers existed essentially since the dawn of computing, this may be the first time ever that the only machines without multicore processors may be those in USB fridges and electric toothbrushes.

parallel curves evolvent
Involute of a circle – parallel curves.

This changes the way that even ordinary programs need to be written. The parallelism inherent in the computation can no longer be extracted automatically from the instruction stream, but the programmer herself needs to make it explicit.

To that end, there were historically several approaches.

Continue reading “Intelⓡ Threading Building Blocks in Red Hat Enterprise Linux 7”

Share