Ready When You Are: Efficient Condition Variables via Delegated Condition Evaluation

05/14/2021
by   Dave Dice, et al.
0

Multi-thread applications commonly utilize condition variables for communication between threads. Condition variables allow threads to block and wait until a certain condition holds, and also enable threads to wake up their blocked peers notifying them about a change to the state of shared data. Quite often such notifications are delivered to all threads, while only a small number of specific threads is interested in it. This results in so-called futile wakeups, where threads receiving the notification wake up and resume their execution only to realize that the condition they are waiting for does not hold and they need to wait again. Those wakeups cause numerous context switches, increase lock contention and cache pressure, translating into lots of wasted computing cycles and energy. In this work, we propose to delegate conditions on which threads are waiting to the thread sending notifications. This enables the latter to evaluate the conditions and send the notification(s) only to the relevant thread(s), practically eliminating futile wakeups altogether. Our initial evaluation of this idea shows promising results, achieving 3-4x throughput improvement over legacy condition variables.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
09/08/2020

Realisability of Control-State Choreographies

Choreographies prescribe the rendez-vous synchronisation of messages in ...
research
05/19/2023

What part of a numerical problem is ill-conditioned?

Many numerical problems with input x and output y can be formulated as a...
research
10/28/2019

An Ensemble Approach toward Automated Variable Selection for Network Anomaly Detection

While variable selection is essential to optimize the learning complexit...
research
04/05/2023

Verifiable identification condition for nonignorable nonresponse data with categorical instrumental variables

We consider a model identification problem in which an outcome variable ...
research
05/02/2023

The Constant in the Theorem of Binev-Dahmen-DeVore-Stevenson and a Generalisation of it

A triangulation of a polytope into simplices is refined recursively. In ...
research
04/26/2018

Visual Estimation of Building Condition with Patch-level ConvNets

The condition of a building is an important factor for real estate valua...
research
07/10/2021

Informing Real-time Corrections in Corrective Shared Autonomy Through Expert Demonstrations

Corrective Shared Autonomy is a method where human corrections are layer...

Please sign up or login with your details

Forgot password? Click here to reset