Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 697 Bytes

vi.g-parallel-library.md

File metadata and controls

25 lines (17 loc) · 697 Bytes

VI.Annex G Parallel library

This clause contains only informative text

This Annex shows several complete examples written using the parallel library

The classes in System.Threading.Parallel enable you to write parallel loops that take advantage of hardware that can execute multiple threads in parallel, without having to get involved in the details of dispatching and synchronizing multiple threads.

[Example: The library lets you take an ordinary sequential loop like this:

for( int i=0; i<n; ++i ) {
    loop body
}

and rewrite it as a parallel loop like this:

new ParallelFor().Run( delegate( int i ) {
    loop body
});

end example]