Index of 4.0 Topics

Operators

.... (periods), download progress indicator, 779

A

Action delegates, 524525

AggregateException, 762765, 803804

AggregateException.Flatten() method, 780

AggregateException.Handle() method, 764, 780

Antecedent tasks, 757

Arity (number of type parameters), 471472

Arrays, unsafe covariance, 497498

AsParallel() operator, 595

AspNetSynchronizationContext, 794

async keyword, 781786, 795798

Asynchronous continuations, 756762

Asynchronous high-latency operations with the TPL, 777781

Asynchronous lambdas, 786787

Asynchronous tasks, multithreading

AggregateException.Handle() method, 764

antecedent tasks, 757

associating data with tasks, 755

asynchronous continuations, 756762

AsyncState, 755

chaining tasks, 757

cold tasks, 752

composing large tasks from smaller one, 756758

continuation tasks, 757

ContinueWith() method, 756758, 760761, 764765

control flow, 755

creating threads and tasks, 750751

hot tasks, 752

Id property, 755

introduction, 751755

invoking, 751753

IsCompleted property, 754

multithreaded programming complexities, 749750

observing unhandled exceptions, 764765

polling a Task<T>, 753754

registering for notification of task behavior, 760761

registering for unhandled exceptions, 766768

Result property, 754

Status property, 754

synchronous delegates, 751

task continuation, 755762

task identification, 755

task scheduler, 750751

task status, getting, 754

TaskContinuationOptions enums, 758759

tasks, definition, 750

tasks vs. delegates, 751

unhandled exception handling with AggregateException, 762765

unhandled exceptions on a thread, 765768

UnhandledException event, 766

AsyncState, 755

AttachedToParent enum, 758

await keyword, 781786, 791792, 795798

await operators, 797798

Awaiting non-Task<T> values, 791792

B

BlockingCollection<T>, 840

Break() method, 808

Breaking parallel loop iterations, 808

C

Canceling

cooperative cancellation, 769

parallel loop iterations, 805806

tasks. See Multithreading, canceling tasks.

CancellationToken object, 769772

CancellationTokenSource.Cancel() method, 770771

Chaining tasks, 757

Cold tasks, 752

Composing large tasks from smaller one, 756758

Concurrent collection classes, 840841

ConcurrentBag<T>, 840

ConcurrentDictionary<T>, 840

ConcurrentQueue<T>, 840

ConcurrentStack<T>, 840

Continuation tasks, 757

ContinueWith() method, 756758, 760761, 764765, 779

Contravariance

definition, 495

delegates, 526527

enabling with in modifier, 495497

Control flow

misconceptions, 784

task continuation, 755

within tasks, 784786

Cooperative cancellation, definition, 769

CountdownEvent, 839840

Covariance

delegates, 526527

enabling with out modifier, 492494

guidelines, 498

type safety, 498

unsafe covariance in arrays, 497498

Covariant conversion, restrictions, 494

Create() factory method, 723724

Create() method, generic types, 471472

Custom asynchronous methods, 787791

D

Delegates

contravariance, 526527

covariance, 526527

general purpose, 524525

guidelines, 525

structural equality, 526527

System.Action, 524525

System.Func, 524525

DenyChildAttach enum, 758

DispatcherSynchronizationContext, 794

Disposable tasks, 774

Dynamic binding, 724725

Dynamic programming. See Programming with dynamic objects.

dynamic directive, 721

Dynamic member invocation, 722

Dynamic principles and behaviors, 721723

dynamic System.Object, 723724

E

Events, resetting, 836839

Exception handling

with AggregateException, 779780, 803804

guidelines, 444

ExecuteSynchronously enum, 759

F

Factory methods, generic types, 471472

ForEach() method, 806

FromCurrentSynchronizationContext() method, 793

Func delegates, 524525

G

General purpose delegates, 524525

Generic types

arity (number of type parameters), 471472

Create() method, 471472

factory methods, 471472

overloading a type definition, 471472

Tuple class, 471472

GetDynamicMemberNames() method, 729

GetResponse() method, 776

GetResponseAsync() method, 779

H

HideScheduler enum, 759

Hill climbing, 802803

Hot tasks, 752

I

Id property, 755

IDisposable, 774

In type parameter, 526

InnerExceptions property, 764, 780, 804

IProducerConsumerCollection<T>, 840

IsCancellationRequested property, monitoring, 770771

IsCompleted property, 754

L

LazyCancellation enum, 759

LINQ queries, running in parallel, 594595

LongRunning enum, 758

Long-running tasks, 773774

M

MaxDegreeOfParallelism property, 807

Member names, retrieving, 729

Methods, calling

applicable calls, 201

compatible calls, 201

Multithreading, asynchronous tasks

AggregateException.Handle() method, 764

antecedent tasks, 757

associating data with tasks, 755

asynchronous continuations, 756762

AsyncState, 755

chaining tasks, 757

cold tasks, 752

composing large tasks from smaller one, 756758

continuation tasks, 757

ContinueWith() method, 756758, 760761, 764765

control flow, 755

creating threads and tasks, 750751

hot tasks, 752

Id property, 755

introduction, 751755

invoking, 751753

IsCompleted property, 754

multithreaded programming complexities, 749750

observing unhandled exceptions, 764765

polling a Task<T>, 753754

registering for notification of task behavior, 760761

registering for unhandled exceptions, 766768

Result property, 754

Status property, 754

synchronous delegates, 751

task continuation, 755762

task identification, 755

task scheduler, 750751

task status, getting, 754

TaskContinuationOptions enums, 758759

tasks, definition, 750

tasks vs. delegates, 751

unhandled exception handling with AggregateException, 762765

unhandled exceptions on a thread, 765768

UnhandledException event, 766

Multithreading, canceling tasks

CancellationToken object, 769772

CancellationTokenSource.Cancel() method, 770771

cooperative cancellation, definition, 769

disposable tasks, 774

IDisposable, 774

IsCancellationRequested property, monitoring, 770771

long-running tasks, 773774

obtaining a task, 772773

TaskCreationOptions.LongRunning option, 773774

Task.Factory.StartNew() method, 772773

Task.Run() method, 772773

WaitHandle, 774

Multithreading, guidelines

long-running tasks, 773774

parallel loops, 801

unhandled exceptions, 768

Multithreading, parallel loop iterations

Break() method, 808

breaking, 808

canceling, 805806

exception handling with AggregateException, 803804

hill climbing, 802803

introduction, 798802

MaxDegreeOfParallelism property, 807

options, 806807

Parallel.For() loops, 807

Parallel.For() method, 808

Parallel.ForEach() loops, 807

Parallel.ForEach() method, 808

ParallelOptions parameter, 807

Stop() method, 808

TPL performance tuning, 802803

work stealing, 802803

Multithreading, PLINQ queries

canceling, 811813

introduction, 809811

Multithreading, task-based asynchronous pattern

AggregateException.Flatten() method, 780

AggregateException.Handle() method, 780

AspNetSynchronizationContext, 794

with async and await, 781786

async and await with the Windows UI, 795798

async keyword, purpose of, 786

asynchronous high-latency operations with the TPL, 777781

asynchronous lambdas, 786787

await keyword, 791792

await operators, 797798

awaiting non-Task<T> values, 791792

ContinueWith() method, 779

control flow misconceptions, 784

control flow within tasks, 784786

custom asynchronous methods, 787791

DispatcherSynchronizationContext, 794

GetResponseAsync() method, 779

handling exceptions, 779780

Process.Kill() method, 789

progress update, 789791

ReadToEndAsync() method, 779

RunProcessAsync() method, 788789

synchronization context, 793795

synchronous high-latency operations, 775777

task drawbacks, overview, 775

task schedulers, 793795

TaskCompletionSource.SetResult() method, 789

TaskCompletionSource<T> object, 788789

Unwrap() method, 779

WriteWebRequestSizeAsync() method, 780, 783

N

Namespaces list of common, 165166

.NET versions, 29

NotOnCanceled enum, 759

NotOnFaulted enum, 758

NotOnRanToCompletion enum, 758

O

OnlyOnCanceled enum, 758

OnlyOnFaulted enum, 759

OnlyOnRanToCompletion enum, 759

OperationCanceledException, 772, 806, 811813

OutOfMemoryException, 444

Overloading a type definition, 471472

P

Parallel loop iterations. See Multithreading, parallel loop iterations.

Parallel.For() loops, 807

Parallel.For() method, 808

Parallel.ForEach() loops, 807

Parallel.ForEach() method, 808

ParallelOptions parameter, 807

ParallelQuery<T> class, 810, 813

PiCalculator.Calculate() method, 753

PLINQ queries, multithreading

canceling, 811813

introduction, 809811

Polling a Task<T>, 753754

PreferFairness enum, 758

Process.Kill() method, 789

Programming with dynamic objects

Create() factory method, 723724

dynamic binding, 724725

dynamic directive, 721

dynamic member invocation, 722

dynamic principles and behaviors, 721723

dynamic System.Object, 723724

GetDynamicMemberNames() method, 729

implementing a custom dynamic object, 726728

introduction, 719

invoking reflection with dynamic, 719720

reflection, support for extension methods, 723

retrieving member names, 729

RuntimeBinderException, 722

signature verification, 722

vs. static compilation, 725726

System.Dynamic.DynamicObject, 728

System.Dynamic.IDynamicMetaObjectProvider interface, 726729

System.Runtime.CompilerServices.CallSite<T>, 723724

TryGetMember() method, 728

TrySetMember() method, 728

type conversion, 721722

type safety, 720721, 726

Progress update, 789791

Pulse() method, 823

R

Race conditions, 595

ReadToEndAsync() method, 779

Reflection

invoking with dynamic, 719720

support for extension methods, 723

Registering for

notification of task behavior, 760761

unhandled exceptions, 766768

Result property, 754

RunContinuationAsynchronously enum, 759

RunProcessAsync() method, 788789

RuntimeBinderException, 722

S

Semaphore, 839840

SemaphoreSlim, 839840

SemaphoreSlim.WaitAsync() method, 840

Set() method, 836837

Signature verification, 722

Standard query operators

AsParallel(), 595

race conditions, 595

running LINQ queries in parallel, 594595

Start() method, 762763

Static compilation vs. dynamic programming, 725726

Status property, 754

Stop() method, 808

Structural equality, delegates, 526527

Synchronization context, 793795

Synchronizing threads. See Thread synchronization.

Synchronizing with Monitor class, 821823

Synchronous delegates, 751

Synchronous high-latency operations, 775777

System.Action, 524525

System.Action delegates, 524525

System.Dynamic.DynamicObject, 728

System.Dynamic.IDynamicMetaObjectProvider interface, 726729

System.Func, 524525

System.Func delegates, 524525

System.Lazy<T>, 430431

System.Runtime.CompilerServices.CallSite<T>, 723724

System.Threading.AutoResetEventSlim, 836839

System.Threading.ManualResetEvent, 836839

System.Threading.ManualResetEventSlim, 836839

System.Threading.Monitor.Enter() method, 823

System.Threading.Monitor.Exit() method, 823

System.Threading.Monitor.Pulse() method, 823

T

TAP (Task-based Asynchronous Pattern), problems addressed by, 799

Task schedulers, 750751, 793795

Task-based asynchronous pattern. See Multithreading, task-based asynchronous pattern.

TaskCanceledException, 772

TaskCompletionSource.SetResult() method, 789

TaskCompletionSource<T> object, 788789

TaskContinuationOptions enums, 758759

Task.ContinueWith() method, 756, 793794, 798

TaskCreationOptions.LongRunning option, 773774

Task.Factory.StartNew() method, 772773

Task.Run() method, 772773

Tasks

antecedent, 757

asynchronous. See Multithreading, asynchronous tasks.

canceling. See Multithreading, canceling tasks.

chaining, 757

cold, 752

composing large from smaller, 756758

continuation, 755762

creating, 750751

definition, 750

vs. delegates, 751

disposable, 774

drawbacks, 775

hot, 752

identification, 755

long-running, 773774

obtaining, 772773

status, getting, 754

TaskScheduler class, 793

Task<T>, polling a, 753754

Thread synchronization

Pulse() method, 823

synchronizing with Monitor class, 821823

System.Threading.Monitor.Enter() method, 823

System.Threading.Monitor.Exit() method, 823

System.Threading.Monitor.Pulse() method, 823

Thread synchronization, synchronization types

BlockingCollection<T>, 840

concurrent collection classes, 840841

ConcurrentBag<T>, 840

ConcurrentDictionary<T>, 840

ConcurrentQueue<T>, 840

ConcurrentStack<T>, 840

CountdownEvent, 839840

IProducerConsumerCollection<T>, 840

reset events, 836839

Semaphore, 839840

SemaphoreSlim, 839840

SemaphoreSlim.WaitAsync() method, 840

Set() method, 836837

System.Threading.AutoResetEventSlim, 836839

System.Threading.ManualResetEvent, 836839

System.Threading.ManualResetEventSlim, 836839

Wait() method, 836837

WaitOne() method, 837

Thread synchronization, thread local storage

definition, 841

ThreadLocal<T>, 841842

ThreadStaticAttribute, 843845

ThreadLocal<T>, 841842

Threads, creating, 750751

ThreadStaticAttribute, 843845

ThrowIfCancellationRequested() method, 772

TPL performance tuning, 802803

TryGetMember() method, 728

TrySetMember() method, 728

Tuple class, 471472

Tuple.Create() method, 471472

Type conversion, dynamic programming, 721722

Type definition, overloading, 471472

Type safety

covariance, 498

dynamic programming, 720721, 726

U

UnauthorizedAccessException, 804

Unhandled exceptions

handling with AggregateException, 762765

on a thread, 765768

UnhandledException event, 766

Unsafe covariance in arrays, 497498

Unwrap() method, 779

W

Wait() method, 836837

WaitForExit() method, 788

WaitHandle, 774

WaitOne() method, 837

Work stealing, 802803

WriteWebRequestSizeAsync() method, 780, 783

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset