Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

bsched Struct Reference

#include <bsched.h>


Detailed Description

Bandwidth scheduler.

A bandwidth scheduler (`B-sched' for short) is made of:

It operates in cooperation with the I/O sources:

  1. Each I/O source registers its I/O callback through the B-sched, so that it is possible to temporarily disable them should we run out of bandwidth for the period.
  2. Each I/O source requests an amount of bandwidth to use.
  3. After use, each I/O source tells the B-sched how much of the allocated bandwidth it really used.

Periodically, the scheduler runs to compute the amount available for the next period.

A list of stealing schedulers can be added to each scheduler. At the end of the period, any amount of bandwidth that has been unused will be given as "stolem" bandwidth to some of the schedulers stealing from us. Priority is given to schedulers that used up all their bandwidth.


Data Fields

tm_t last_period
 Last time we ran our period.

GList * sources
 List of bio_source_t.

GSList * stealers
 List of bsched_t stealing bw.

gchar * name
 Name, for tracing purposes.

gint count
 Amount of sources.

gint type
 Scheduling type.

gint flags
 Processing flags.

gint period
 Fixed scheduling period, in ms.

gint min_period
 Minimal period without correction.

gint max_period
 Maximal period without correction.

gint period_ema
 EMA of period, in ms.

gint bw_per_second
 Configure bandwidth in bytes/sec.

gint bw_max
 Max bandwidth per period.

gint bw_actual
 Bandwidth used so far in period.

gint bw_last_period
 Bandwidth used last period.

gint bw_last_capped
 Bandwidth capped last period.

gint bw_slot
 Basic per-source bandwidth lot.

gint bw_ema
 EMA of bandwidth really used.

gint bw_stolen
 Amount we stole this period.

gint bw_stolen_ema
 EMA of stolen bandwidth.

gint bw_delta
 Running diff of actual vs.

gint bw_unwritten
 Data that we could not write.

gint bw_capped
 Bandwidth we refused to sources.

gint last_used
 Nb of active sources last period.

gint current_used
 Nb of active sources this period.

gboolean looped
 True when looped once over sources.


Field Documentation

gint bsched::bw_actual
 

Bandwidth used so far in period.

gint bsched::bw_capped
 

Bandwidth we refused to sources.

gint bsched::bw_delta
 

Running diff of actual vs.

theoric

gint bsched::bw_ema
 

EMA of bandwidth really used.

gint bsched::bw_last_capped
 

Bandwidth capped last period.

gint bsched::bw_last_period
 

Bandwidth used last period.

gint bsched::bw_max
 

Max bandwidth per period.

gint bsched::bw_per_second
 

Configure bandwidth in bytes/sec.

gint bsched::bw_slot
 

Basic per-source bandwidth lot.

gint bsched::bw_stolen
 

Amount we stole this period.

gint bsched::bw_stolen_ema
 

EMA of stolen bandwidth.

gint bsched::bw_unwritten
 

Data that we could not write.

gint bsched::count
 

Amount of sources.

gint bsched::current_used
 

Nb of active sources this period.

gint bsched::flags
 

Processing flags.

tm_t bsched::last_period
 

Last time we ran our period.

gint bsched::last_used
 

Nb of active sources last period.

gboolean bsched::looped
 

True when looped once over sources.

gint bsched::max_period
 

Maximal period without correction.

gint bsched::min_period
 

Minimal period without correction.

gchar* bsched::name
 

Name, for tracing purposes.

gint bsched::period
 

Fixed scheduling period, in ms.

gint bsched::period_ema
 

EMA of period, in ms.

GList* bsched::sources
 

List of bio_source_t.

GSList* bsched::stealers
 

List of bsched_t stealing bw.

gint bsched::type
 

Scheduling type.


The documentation for this struct was generated from the following file:
Generated on Sun Feb 12 10:50:11 2006 for Gtk-Gnutella by doxygen 1.3.6