The trend of Computer hardware is more and more cores.
on multi-core machine
->don’t block the UI-> thread affinity
1. set the scene
5.declarative data parallelism
vs 2010 consoles applications
tree class, each node in tree is an integer
1. tree class
2.static method for construct a sample tree
1.program file with main()
2.walktree() ->call process item for each node in tree.
3.processitem()->do some work for each node’s data
before optimize : 15022
//optimize the processitem function*)->done
1st attempt , not so good. one thread for each node is bad!
Demo3: what happen when processitem needs other node’s data to be processed first?.
use keyword future!
write code once, and it will scale with better hardware.
partition works into multiple chunks->need fine-grained parallelism
Demo 3: New debugger
Bonus: coordination data structure.