Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

A Google Summer of Code 2020 Report

MariaDB. Optimizing the distribution of tasks in a treadpool

Project description

The purpose of this project is to update algorithm of task distribution in a threadpool in MariadDB. Specifically, what algorithm to use for dynamic concurrency. This is the algorithm "hill-climbing", which is used in .NET ThreadPool.

Implementation

class hill_climbing
  • is the main class, that contains code for HillClimbing algorithm.
class hill_climbing_mgr
  • class, that manipulates with HillClimbing params.
class complex
  • class for working with complex numbers, used in HillClimbing algorithm.
void thread_pool_generic::maybe_wake_or_create_thread()
  • function, that uses HillClimbing algorithm and trying to predict optimal concurrency level.

Source Code (GitHub)

https://github.com/sapiest/server/commit/c534ab525369081706e23f860bbd6467bca880e6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment