summaryrefslogtreecommitdiff
path: root/src/or/scheduler.h
AgeCommit message (Collapse)Author
2018-04-05Add an API for a scheduled/manually activated event in the mainloopNick Mathewson
Using this API lets us remove event2/event.h usage from half a dozen modules, to better isolate libevent. Implements part of ticket 23750.
2018-02-01Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-31ns: Add a before and after consensus has changed notificationDavid Goulet
In 0.3.2.1-alpha, we've added notify_networkstatus_changed() in order to have a way to notify other subsystems that the consensus just changed. The old and new consensus are passed to it. Before this patch, this was done _before_ the new consensus was set globally (thus NOT accessible by getting the latest consensus). The scheduler notification was assuming that it was set and select_scheduler() is looking at the latest consensus to get the parameters it might needs. This was very wrong because at that point it is still the old consensus set globally. This commit changes the notify_networkstatus_changed() to be the "before" function and adds an "after" notification from which the scheduler subsystem is notified. Fixes #24975
2017-12-11Make get_scheduler_state_string available to scheduler*.cMatt Traudt
2017-12-11Fix cosmetic issues around scheduler_set_channel_stateMatt Traudt
Whitespace issues Line length Unused variable
2017-12-11Bug:24531 Function to change channel scheduler state for easy debugging added.ArunaMaurya221B
2017-12-11Bug:24531 Add function to change scheduler state and always use itArunaMaurya221B
2017-10-03sched: Implement SCHED_BUG()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25sched: make interval a plain int; initialize with macroMatt Traudt
2017-09-25sched: Make KISTSchedRunInterval non negativeDavid Goulet
Fixes #23539. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-22sched: only log when scheduler type changesMatt Traudt
Closes 23552. Thanks dgoulet for original impl
2017-09-19sched: reorder code to fit comment bodies; comment typosMatt Traudt
Closes 23560
2017-09-15Run our #else/#endif annotator on our source code.Nick Mathewson
2017-09-15sched: Define SCHEDULER_KIST_PRIVATE for more encapsulationDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Make the scheduler object staticDavid Goulet
Each type of scheduler implements its own static scheduler_t object and returns a reference to it. This commit also makes it a const pointer that is it can only change inside the scheduler type subsystem but not outside for extra protection. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Don't expose the global scheduler libevent objectDavid Goulet
Instead, add wrappers to do the needed action the different scheduler needs with the libevent object. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Add Schedulers torrc optionDavid Goulet
This option is a list of possible scheduler type tor can use ordered by priority. Its default value is "KIST,KISTLite,Vanilla" which means that KIST will be used first and if unavailable will fallback to KISTLite and so on. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: rename scheduler to the_schedulerMatt Traudt
2017-09-15sched: validate KIST sched optionsMatt Traudt
2017-09-15sched: switch to monotonic time; add/fix comments, style, and logs msgsMatt Traudt
2017-09-15sched: Detect KIST support at compile timeDavid Goulet
Add a detection for the KIST scheduler in our build system and set HAVE_KIST_SUPPORT if available. Adapt the should use kist function with this new compile option. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Implement the KIST schedulerMatt Traudt
Closes #12541 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-07consensus: Add a generic notification function on new consensusMatt Traudt
Some groundwork for the KIST scheduler implementation. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-03-15Run the copyright update script.Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-02-27Update the copyright year.Nick Mathewson
2015-02-06Fix scheduler compilation on targets where char is unsigned.Yawning Angel
Per discussion with nickm, the `dir` argument should be a int rather than a signed char. Fixes bug #14764.
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-10-07Make queue thresholds and flush size for global scheduler into config optionsAndrea Shepard
2014-09-30Make scheduler_compare_channels() mockableAndrea Shepard
2014-09-30Make scheduler_run() mockableAndrea Shepard
2014-09-30Expose scheduler_compare_channels() to test suiteAndrea Shepard
2014-09-30Make some scheduler.c static functions visible to the test suiteAndrea Shepard
2014-09-30Make scheduler_channel_doesnt_want_writes() mockableAndrea Shepard
2014-09-30Make scheduler_channel_doesnt_want_writes() mockableAndrea Shepard
2014-09-30Make scheduler_release_channel() mockableAndrea Shepard
2014-09-30Implement scheduler_touch_channel()Andrea Shepard
2014-09-30Schedule according to a queue size heuristicAndrea Shepard
2014-09-30Implement scheduler mechanism to track lists of channels wanting cells or ↵Andrea Shepard
writes; doesn't actually drive the cell flow from it yet