GSoC/2018/StatusReports/AndreyKamakin: Difference between revisions
Line 14: | Line 14: | ||
=== First evaluation === | === First evaluation === | ||
From 14-th of May up to 11-th of June I was busy integrating lock free map from [https://github.com/preshing/junction Junction]. We decided to take the fastest one which happened to be [http://preshing.com/20160201/new-concurrent-hash-maps-for-cpp/ Leapfrog]. I tried to make a wrapper around it which is called KisTileHashTableTraits2 and then integrate it instead of KisTileHashTableTraits. The most part is almost done and tables are swapped. Right now I have some troubles with garbage collection and [https://en.wikipedia.org/wiki/ABA_problem ABA] problem, but problems seem to be solvable. | |||
== Project related links == | == Project related links == |
Revision as of 18:18, 11 June 2018
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
Community bonding period
During community bonding period I mostly was busy reading about lock free programming and how to work in multithreaded environment. Then we decided on what tasks must be done and how.
First evaluation
From 14-th of May up to 11-th of June I was busy integrating lock free map from Junction. We decided to take the fastest one which happened to be Leapfrog. I tried to make a wrapper around it which is called KisTileHashTableTraits2 and then integrate it instead of KisTileHashTableTraits. The most part is almost done and tables are swapped. Right now I have some troubles with garbage collection and ABA problem, but problems seem to be solvable.