Skip to content
0:00 / 0:00

#workcontracts#task-basedconcurrency#lowlatency

Work Contracts - Rethinking Task Based Concurrency & Parallelism for Low Latency C++ - CppCon 2024

CppCon

189K subscribers • 122 videos on Hallway • Conference channel

YouTube
  • Recommended by 2 people: 1 on Lobsters and 1 in engineering communities.
  • Presented by Michael A. Maniscalco
  • Linked in the descriptionCppCon/CppCon2024
  • An opinion. It argues one side of a question engineers disagree on.

Advanced. Deep dive for people who know the field.

12K views1 year ago2 recommendations

Systems programmingSoftware designC++Concurrency and parallelismPerformance and optimization

Michael A. Maniscalco introduces work contracts as a low-overhead alternative to task graphs for low-latency concurrency in C++.

cppcon.org --- Work Contracts - Rethinking Task Based Concurrency and Parallelism for Low Latency C++ - Michael A Maniscalco - CppCon 2024 --- Task-based concurrency offers benefits in streamlining software and enhancing overall responsiveness. Numerous frameworks build upon this approach by furnishing abstractions that harness the capabilities of modern multi-core processors and distributed computing environments. These frameworks achieve this by facilitating the creation of task graphs, which simplify the management of task execution order and dependencies between tasks. However, these frameworks are typically not well suited for use in low latency environments where every nanosecond matters, and any additional overhead introduced by managing task graphs can impact the system's ability to meet stringent latency requirements. This presentation introduces Work Contracts, a novel approach specifically tailored for low-latency environments, which re-imagines both task-based concurrency as well as tasks themselves. We present an innovative lock free, often wait free, data structure designed to significantly enhance scalability in parallel task distribution, particularly under high contention. Additionally, we introduce concepts which enhance tasks with internal state allowing for single threaded or parallel execution, recurring execution, and deterministic asynchronous task destruction. Finally, we examine usage cases for Work Contracts to showcase the advantages that this solution makes possible, resulting in cleaner, more manageable, and more scalable software which is well suited for low latency applications. --- Slides: github.com/CppCon/CppCon2024/blob/main/Presentations/Work_Co… Work at Hudson River Trading (HRT): tinyurl.com/safxfctf --- Michael Maniscalco Michael Maniscalco has been a professional C++ developer for over 25 years. Initially he worked in the area of data compression (Intelligent Compression Technologies, later Viasat) and, for the last decade, he has been employed as a principal engineer and software architect at Lime Trading where he designs and authors low latency software for use in HFT.   He has invented several novel data compression algorithms including M99 and M03 as well as MSufSort, a pioneering algorithm for suffix array construction. His works have been published and cited in numerous academic publications including the Journal of Experimental Algorithms. On rare occasion he finds the time to add to his website and github repo, "Building C++" which is a platform dedicated to "Architecting systems with modern C++." --- CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this ye

Why it's here

2 people recommend this

What people say. Recommended as a modern approach to building lightweight, low-latency threading libraries for game engines.

u/cone_forest_in r/gameenginedevs • Recommends

On “Paralleism and Multithreading”

The companies I worked at seem to be using TBB/OpenMP/Boost for parallelism. Those libraries are huge and probably not the best choice for a simple game engine. A lot of people seem to roll their own solutions (myself included). As I've been developing an asset manager, I decided to write my own threading library based on a new and shiny work_contract library. Here's a link. It's aimed to be a perfectly fair scheduler so it comes with its quirks. The main benefit is that it scales perfectly unlike classic lock-free queue approaches. If you don't like my wrapper I suggest taking a look at the raw work_contract library. There was a CppCon talk about it and it's **really** impressive

jibsenon Lobsters • Recommends

Work Contracts - Rethinking Task Based Concurrency & Parallelism for Low Latency C++