Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::scheduling_group Class Reference

Detailed Description

Identifies function calls that are accounted as a group.

A scheduling_group is a tag that can be used to mark a function call. Executions of such tagged calls are accounted as a group.

#include <seastar/core/scheduling.hh>

Public Member Functions

constexpr scheduling_group () noexcept
 Creates a scheduling_group object denoting the default group.
 
bool active () const noexcept
 
const sstring & name () const noexcept
 
bool operator== (scheduling_group x) const noexcept
 
bool operator!= (scheduling_group x) const noexcept
 
bool is_main () const noexcept
 
template<typename T >
T & get_specific (scheduling_group_key key) noexcept
 
void set_shares (float shares) noexcept
 

Member Function Documentation

◆ get_specific()

template<typename T >
T& seastar::scheduling_group::get_specific ( scheduling_group_key  key)
inlinenoexcept

Returnes a reference to this scheduling group specific value

Template Parameters
T- the type of the scheduling specific type (cannot be deduced)
Parameters
key- the key of the value to retrieve.
Returns
A reference to this scheduling specific value.

◆ set_shares()

void seastar::scheduling_group::set_shares ( float  shares)
noexcept

Adjusts the number of shares allotted to the group.

Dynamically adjust the number of shares allotted to the group, increasing or decreasing the amount of CPU bandwidth it gets. The adjustment is local to the shard.

This can be used to reduce a background job's interference with a foreground load: the shares can be started at a low value, increased when the background job's backlog increases, and reduced again when the backlog decreases.

Parameters
sharesnumber of shares allotted to the group. Use numbers in the 1-1000 range.

The documentation for this class was generated from the following file: