multitasking in applications
Post on 22-Apr-2015
1.439 Views
Preview:
DESCRIPTION
TRANSCRIPT
Multitasking in
Applications
why?
no arguments against needing to be multi-something?– avg cores on desktop: 2.68– cloud: scalable because of lots of small
parts working separately
Some are more equal than others
Common logic of add threads = going faster is just wrong.• Physical CPU core limits• Balancing cost to create vs. benefit• I/O bound vs. CPU bound
Threading is just hardCode complexity• Providing results at the end of processing• Cross thread communication• Updating the UILogic issues• Balancing new threads vs. reusing threadsReally understanding the bottlenecks
what does .NET give us?
1.0 – threading, thread pool
4 – tasks
vNext - async
The trend?
Threading is done• Done != Dead• Not much more can be added or changed• Easier with thread poolsTasking is the new trend• Threading lite• Easier to consume
Single Threaded MultiThreaded ThreadPool Plinq PlinqForAll ParallelExtensions TPL Async
257.8
6475
2930.1
675
0.2
790159
287.6
1645
261.9
64985
382.5
2188
0.5
170296
7.9
784563
0.8
720499
2129.1
218
0.4
340248
0.9
580548
1.0
190583
1.0
290589
0.5
15029
7.3
804221
1.7
32099
2064.1
181
0.7
820447
1.6
480943
1.4
150809
1.4
680839
1.7
320991
7.1
844109
ConsoleLockingConcurrent
demo time
Other options?
Reactive ExtensionsQbservable All those good ideas from the 60’s like pub/sub
Summary
Their goal is to make this easierStop thinking in threadsOn going process of evaluate, test & review
top related