Skip to content

Instantly share code, notes, and snippets.

@sapiest
Last active August 28, 2020 03:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapiest/d9bc42f3d28d713f070b91ed9b974759 to your computer and use it in GitHub Desktop.
Save sapiest/d9bc42f3d28d713f070b91ed9b974759 to your computer and use it in GitHub Desktop.

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