Assessments
This section contains answers to questions from all chapters.
This section contains answers to questions from all chapters.
System.Threading.Thread
object. Thread.IsBackground
property to true
before calling Thread.Start()
. ThreadStateException
exception. Thread.Priority
value. ThreadPriority.Highest
.Thread.Abort()
is not supported by .NET 6. The code will not compile. Thread.Start(data)
. Register
method. ThreadPool
Task
, Task<T>
, ValueTask
, or ValueTask<T>
ConcurrentDictionary<TKey, TValue>
BlockingCollection<T>
ThreadStatic
. Monitor.TryEnter
.Interlocked
.Interlocked.Add
.MaxDegreeOfParallelism
.WithDegreeOfParallelism
extension method.ThreadPool.GetMinThreads()
.Task
or Task<T>
.Task.WhenAll
.Task.Factory.StartNew
.ThreadPool
.Application.Current.Dispatcher.Invoke
.this.BeginInvoke
.this.InvokeRequired
property.Task.Result
.Task.WhenAll()
.Task.WaitAll()
.Task
, Task<TResult>
, ValueTask
, or ValueTask<TResult>
.Async
. Task.Run
.Parallel.For
.Parallel.ForEachAsync
. Parallel.Invoke
. TaskCreationOptions.AttachToParent
. TaskCreationOptions.DenyAttach
. Task.Run
will always deny child tasks from attaching. Also, Task.Run
has no overloaded methods to provide TaskCreationOptions
. for
and foreach
loops can be faster if each loop iteration is fast-running and/or there are only a few iterations of the loop.The following are the answers to this chapter’s questions:
JoinBlock
.BufferBlock
is a propagator block.BufferBlock
.JoinTo()
.Complete()
.SendAsync()
.ReceiveAsync()
.AsParallel()
. AsSequential()
. AsOrdered()
. ForAll()
.AsOrdered()
can significantly decrease performance for a query. OrderBy
and OrderByDescending
. They will default to ParallelMergeOptions.FullyBuffered
. ParallelMergeOptions.NotBuffered
.BlockingCollection<T>
. ConcurrentQueue<T>
. BlockingCollection<T>
. ConcurrentDictionary<TKey, TValue>
. Enqueue()
. TryAdd()
and TryGetValue()
. .PNG
files. CancellationToken.IsCancellationRequested
CancellationTokenSource
OperationCanceledException
ManualResetEventSlim
ManualResetEventSlim.Reset
CancellationTokenSource.CreateLinkedTokenSource
Fact
SpinLock.WaitUntil
AggregateException
Exception
Assert.NotNull
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at customercare@packtpub.com for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.