Jump to content

GSoC/2018/StatusReports/AndreyKamakin

From KDE Community Wiki

Optimize multithreading in Krita's Tile Manager

Nowadays almost everybody has a pc with multiple cores, this opens doors to parallel programming, when 2 or more tasks are executing simultaneously, allowing for better performance. And thus software must be written by taking this into account. In single threaded execution of a program there is no need to monitor shared resources, because it is guaranteed that only one thread can access resource at a given point in time. But in multithreaded program flow it is a common problem that resources must be shared between threads, futhermore, situations such as dirty read/write, etc must be excluded for normal program behavior. So the simplest solution is to use locks on operations that must access shared resources so that only one thread can perform read/write operations on resources. This works good in low concurrent environments, but starts to show drop downs when more threads are added. To avoid that, one can use so called lock-free idiom, when no locks are held to access shared resources and this is basically the main project idea, to rewrite logic from using locks on lock-free.

Project Goals

Implement optimization on

  • KisTileHashTableTraits
  • KisTiledDataManager
  • Memory allocation

Work report

During community bonding period I mostly was busy reading about lock free programming and how to work in multithreaded environment. Then we made decided on what tasks must be done and how.

Project related links