ThreadWeaver in KDE
Frameworks 5
Demos, New Features, Performance
Mirko Boehm <mirko@kde.org>
Akademy 2013
1Friday, July 1...
Agenda
introduction to ThreadWeaver
key concepts: job aggregates, policies, queues
API changes for Frameworks 5
performanc...
CWD: ~
miroslav@silberpfeil: >whoami
- KDE Contributor since 1997:
-- hacking (kdecore, kdepim, applications)
-- board mem...
Agenda
introduction to ThreadWeaver
key concepts: job aggregates, policies, queues
API changes for Frameworks 5
performanc...
Hello World
Demo time!
5Friday, July 19, 13
Hello World demo(s)
global ThreadWeaver pool
job memory management
shared pointers
raw pointers, jobs as stack variables
L...
Sequence
Demo
Demo time!
7Friday, July 19, 13
Sequence Demo
job aggregates: collections, sequences
job error reporting
sequences abort on failure
signals and slots to c...
Image
Viewer
Demo time!
9Friday, July 19, 13
Image Viewer
queue policies
resource restrictions
dependencies
job priorities
worker thread count, individual queue instan...
Outlook
Use job aggregates
to model execution
flow graph.
(Or: How to draw a
sad robot.)
11Friday, July 19, 13
Agenda
introduction to ThreadWeaver
key concepts: job aggregates, policies, queues
API changes for Frameworks 5
performanc...
Jobs
units of queueing and execution
shared pointers for memory management
raw pointers for stack variables
success status...
Queue Policies
decide whether or not a job can be executed
are assigned to jobs
may be shared between jobs or queues
built...
Queues
manage worker threads
global instance or individual instances
suspend/resume/finish
signaling
15Friday, July 19, 13
Philosophy
scheduling vs. programmed concurrency
critical path modeling
minimalism (jobs, queueing methods, concepts)
simp...
Agenda
introduction to ThreadWeaver
key concepts: job aggregates, policies, queues
API changes for Frameworks 5
performanc...
API changes
few, but important
shared pointers for jobs
global instance child of QApplication
public Queue class
ExecuteWr...
Agenda
introduction to ThreadWeaver
key concepts: job aggregates, policies, queues
API changes for Frameworks 5
performanc...
20Friday, July 19, 13
Agenda
introduction to ThreadWeaver
key concepts: job aggregates, policies, queues
API changes for Frameworks 5
performanc...
Feature quizz
progress tracking
minijobs
embed QRunnables
Job::execUntilFinished(QEventLoop/QDialog/qApp)
AnyOfCollection
...
Questions?
23Friday, July 19, 13
References
demos:
github.com/mirkoboehm/ThreadWeaverDemos
benchmarks:
github.com/mirkoboehm/QBenchmarkParser
code:
kdelibs...
Upcoming SlideShare
Loading in …5
×

ThreadWeaver in KDE Frameworks 5

2,015 views
1,853 views

Published on

Presented on July 14, 2013 at the annual KDE Akademy conference:

ThreadWeaver is the concurrency scheduler framework in KDE. It provides a high-level multi-threading API convenient for application programming, combined with powerful features like aggregate tasks, task dependencies and queue policies. With the dawn of KDE Frameworks, ThreadWeaver has been refactored, extensively tested, benchmarked and generally polished.

This presentation will introduce the audience to ThreadWeaver programming and central concepts, explain the (few) changes and additions in the API in KDE Frameworks, and show some performance benchmarking results.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,015
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ThreadWeaver in KDE Frameworks 5

  1. 1. ThreadWeaver in KDE Frameworks 5 Demos, New Features, Performance Mirko Boehm <mirko@kde.org> Akademy 2013 1Friday, July 19, 13
  2. 2. Agenda introduction to ThreadWeaver key concepts: job aggregates, policies, queues API changes for Frameworks 5 performance considerations, benchmarks outlook and new feature quizz 2Friday, July 19, 13
  3. 3. CWD: ~ miroslav@silberpfeil: >whoami - KDE Contributor since 1997: -- hacking (kdecore, kdepim, applications) -- board member 1999 to 2006 -- Desktop Summit 2011 - FSFE Team Germany - researching Free Software and Intellectual Property issues at TU Berlin - European Representative, Open Invention Network - Founder/CEO,Endocode AG - married, two kids, lives in Berlin CWD: ~ miroslav@silberpfeil: > 3Friday, July 19, 13
  4. 4. Agenda introduction to ThreadWeaver key concepts: job aggregates, policies, queues API changes for Frameworks 5 performance considerations, benchmarks outlook and new feature quizz 4Friday, July 19, 13
  5. 5. Hello World Demo time! 5Friday, July 19, 13
  6. 6. Hello World demo(s) global ThreadWeaver pool job memory management shared pointers raw pointers, jobs as stack variables Lambda jobs 6Friday, July 19, 13
  7. 7. Sequence Demo Demo time! 7Friday, July 19, 13
  8. 8. Sequence Demo job aggregates: collections, sequences job error reporting sequences abort on failure signals and slots to communicate sharing data between jobs 8Friday, July 19, 13
  9. 9. Image Viewer Demo time! 9Friday, July 19, 13
  10. 10. Image Viewer queue policies resource restrictions dependencies job priorities worker thread count, individual queue instances 10Friday, July 19, 13
  11. 11. Outlook Use job aggregates to model execution flow graph. (Or: How to draw a sad robot.) 11Friday, July 19, 13
  12. 12. Agenda introduction to ThreadWeaver key concepts: job aggregates, policies, queues API changes for Frameworks 5 performance considerations, benchmarks outlook and new feature quizz 12Friday, July 19, 13
  13. 13. Jobs units of queueing and execution shared pointers for memory management raw pointers for stack variables success status, cancellation requests priorities as a hint to the scheduler 13Friday, July 19, 13
  14. 14. Queue Policies decide whether or not a job can be executed are assigned to jobs may be shared between jobs or queues built-ins: resource restriction policy, dependency policy custom policies can be implemented 14Friday, July 19, 13
  15. 15. Queues manage worker threads global instance or individual instances suspend/resume/finish signaling 15Friday, July 19, 13
  16. 16. Philosophy scheduling vs. programmed concurrency critical path modeling minimalism (jobs, queueing methods, concepts) simplicity 16Friday, July 19, 13
  17. 17. Agenda introduction to ThreadWeaver key concepts: job aggregates, policies, queues API changes for Frameworks 5 performance considerations, benchmarks outlook and new feature quizz 17Friday, July 19, 13
  18. 18. API changes few, but important shared pointers for jobs global instance child of QApplication public Queue class ExecuteWrapper all *RunHelper* classes removed 18Friday, July 19, 13
  19. 19. Agenda introduction to ThreadWeaver key concepts: job aggregates, policies, queues API changes for Frameworks 5 performance considerations, benchmarks outlook and new feature quizz 19Friday, July 19, 13
  20. 20. 20Friday, July 19, 13
  21. 21. Agenda introduction to ThreadWeaver key concepts: job aggregates, policies, queues API changes for Frameworks 5 performance considerations, benchmarks outlook and new feature quizz 21Friday, July 19, 13
  22. 22. Feature quizz progress tracking minijobs embed QRunnables Job::execUntilFinished(QEventLoop/QDialog/qApp) AnyOfCollection UI elements/visualizations 22Friday, July 19, 13
  23. 23. Questions? 23Friday, July 19, 13
  24. 24. References demos: github.com/mirkoboehm/ThreadWeaverDemos benchmarks: github.com/mirkoboehm/QBenchmarkParser code: kdelibs frameworks branch, tier1/threadweaver 24Friday, July 19, 13

×