Presentation is loading. Please wait.

Presentation is loading. Please wait.

H IGH - LEVEL M ULTITHREADED P ROGRAMMING [P ART II] Primož Gabrijelčič.

Similar presentations


Presentation on theme: "H IGH - LEVEL M ULTITHREADED P ROGRAMMING [P ART II] Primož Gabrijelčič."— Presentation transcript:

1 H IGH - LEVEL M ULTITHREADED P ROGRAMMING [P ART II] Primož Gabrijelčič

2 B ACKGROUND I NFORMATION

3 About Me Primož Gabrijelčič Programmer, consultant, writer, speaker – thedelphigeek.com – Hacking multithreaded code since 1999

4 About OmniThreadLibrary „VCL for multithreading“ Delphi 2007 – XE3[4] Open source – OpenBSD license – – omnithreadlibrary.googlecode.com Win32/Win64

5 About the Webinars Code and video: Code = free, video = $10 20 free books, courtesy of the De Novo Software,

6 High-Level Abstractions Async [/Await] Future Join ForEach ParallelTask BackgroundWorker ForkJoin Pipeline

7 High-Level Abstractions Async [/Await] Future Join ForEach ParallelTask BackgroundWorker ForkJoin Pipeline Start multiple background tasks [and wait]

8 Join

9 High-Level Abstractions Async [/Await] Future Join ForEach ParallelTask BackgroundWorker ForkJoin Pipeline Start multiple copies of a single task

10 ParallelTask

11 High-Level Abstractions Async [/Await] Future Join ForEach ParallelTask BackgroundWorker ForkJoin Pipeline Background request-processing service

12 Background Worker

13 BackgroundWorker Usage service := Paralell.BackgroundWorker. OnRequestDone(code1).Execute(code2); workItem := service.CreateWorkItem(data); service.Schedule(workItem) service.Terminate; service := nil;

14 High-Level Abstractions Async [/Await] Future Join ForEach ParallelTask BackgroundWorker ForkJoin Pipeline Divide and conquer

15 Fork/Join

16 Fork/Join Usage computation := Parallel.ForkJoin; compute1 := computation.Compute(action); – Inside action: computation.Compute(newAction) compute2 := computation.Compute(action); compute1.Value / compute1.Await compute2.Value / compute2.Await

17 P ARTING N OTES

18 Keep in Mind Don’t parallelize everything Rethink the algorithm Data flow dictates the abstraction Measure the improvements Test, test and test

19 Code & Video Will be available shortly at


Download ppt "H IGH - LEVEL M ULTITHREADED P ROGRAMMING [P ART II] Primož Gabrijelčič."

Similar presentations


Ads by Google