Академический Документы
Профессиональный Документы
Культура Документы
1/22/2012 2:37 PM
Caveats
This is a C++ talk
Visual Studio 2010 on Windows Xbox availability is undetermined
Agenda
Define (15 minutes)
Concurrency Runtime Architecture Concepts
We will briefly cover the concepts Dive into applying those concepts
Why?
Productivity:
Make it easier to express parallelism Make it easier to debug parallel code Reduce the likelihood of making errors
Native Libraries
Performance:
Reduce runtime overhead to enable fine-grained parallelism Scale on any hardware platform without explicitly coding to the platform
Data Structures
UMS Threads
Threads
Key: Key :
W indow s 7
2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
MGB 2005
1/22/2012 2:37 PM
Cooperative Blocking
Use runtime awareness of blocking events to switch to new work on a hardware thread
Task group
A collection of tasks that form a logical computation or subcomputation Wait together or cancel together
Platform Scalability
Map expressed parallelism onto the platforms available parallelism Low overhead allowing for decomposition to small tasks
Parallel Loops
STL style algorithms with support for cancellation and composition
Concurrent Containers
Containers that safely manage concurrent use
Message Blocks
Thread-safe containers Participants in message-passing May be source, target, or both
Demo
Scaling up your game for the modern world
Control Flow
Runtime connection of sources to targets allows efficient pipeline execution Conditionally accept, filter, and join messages
Review
Scale Computation
Parallel Patterns Minimal code changes Recursion without thread explosion Simplify decomposition
Task Parallelism
task_handle task_group structured_task_group
Parallel Algorithms
parallel_for parallel_for_each parallel_invoke
Coordinate State
Coordinate shared-state with message passing Keep state in the actor instead of globally or through TLS Dont limit your imagination on what you can pass as a message
Synchronization Primitives
reader_writer critical_section event
Concurrent Containers
concurrent_queue concurrent_vector combinable <T>
2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
MGB 2005
1/22/2012 2:37 PM
Sample Pack
http://code.msdn.microsoft.com/concrtextras http://code.msdn.microsoft.com/concrtextras
Agents Extras
priority_buffer bounded_buffer alternator join_transform
Pipelining tasks
transformer<T,U> call<T>
PPL Extras
parallel_all_of, parallel_any_of, parrallel_none_of parallel_for_fixed, parallel_for_each_fixed parallel_accumulate, parallel_transform parallel_partial_sum, parallel_partial_sum_fixed
Message Control
choice join
Message Passing
send() / asend() receive()
co-operatively block if needed
Helper Functions
task_scheduler, schedule_group scoped_oversubcription_token countdown_event Barrier
Coming Soon
concurrent_unordered_map concurrent_unordered_set concurrent_hash parallel_sort,connect More demos
Summary
Use Concurrency Runtime so you can focus on scaling your algorithms and not the plumbing Start thinking with parallel patterns
Agents, message blocks, and controls allow you to naturally express data flow that avoids shared state Loops and searches may be good candidates for parallelization
www.microsoftgamefest.com
2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.