Who enjoys using an app that is really slow?
Nobody
What can be defined as a path of execution within an executable application?
A thread
Spawning additional threads will not necessarily make applications faster on what type of machines?
Single-core machines
What namespace released with .NET 1.0 offers one approach to building multithreaded applications?
System.Threading
When you write code that creates a new thread, can you guarantee that the thread executes immediately?
No, you can only instruct the OS/runtime to execute it as soon as possible, typically when the thread scheduler gets to it
What namespace in .NET provides types that enable the direct construction of multithreaded apps?
System.Threading
What type in System.Threading represents a thread that executes within the .NET runtime and can be used to spawn additional threads in the originating AppDomain?
Thread
What type in System.Threading provides a mechanism for executing a method at specified intervals?
Timer
What type in System.Threading allows you to limit the number of threads that can access a resource concurrently?
Semaphore
What most primitive type in System.Threading represents an object-oriented wrapper around a given path of execution within an AppDomain?
Thread
What instance-level member of System.Threading.Thread returns a bool that indicates if the thread has been started (and has not yet terminated or aborted)?
IsAlive
What instance-level member of System.Threading.Thread gets or sets a value that indicates whether the thread is a background thread?
IsBackground
What instance-level member of System.Threading.Thread instructs the .NET runtime to terminate the thread as soon as possible?
Abort()
What is a good property to set on a System.Threading.Thread instance that will greatly simplify your debugging endeavors?
Name
What instance-level member of System.Threading.Thread instructs the .NET runtime to start the thread as soon as possible?
Start()
What will happen if you decorate a method with the async keyword but that method does not have an internal await method call?
A compiler warning
What keywords can you use in .NET that will make the compiler generate a good deal of threading code on your behalf?
async and await
What static method of System.Threading.Thread suspends the current thread for a specified time?
Sleep()
What type in System.Threading is a delegate type used in conjunction with Timer?
TimerCallback
What type in System.Threading allows you to interact with the .NET runtime-maintained thread pool within a given process?
ThreadPool
What are threads that can prevent the current app from terminating?
Foreground threads
What are threads that are viewed by the .NET runtime as expendable paths of execution that can be ignored at any point in time?
Background threads
The .NET runtime will not shut down an app until all of what kind of thread have ended?
Foreground threads
What are sometimes called daemon threads?
Background threads
What issue can be described as the possibility of different threads changing the value of any shared data?
Concurrency
What type and delegate can you use in .NET when you need a function to be called every so often by the app (especially for noncritical background tasks like checking for new emails)?
System.Threading.Timer and TimerCallback
The types of what namespace are collectively referred to as the Task Parallel Library?
System.Threading.Tasks
What newer approach to multithreaded app development (newer than System.Threading) did Microsoft introduce with .NET 4.0?
Task Parallel Library (TPL)
What C# keyword qualifies that a method, lambda expression, or anonymous method should be called in an asynchronous manner automatically?
async
What can you use to mark a method with that will cause the .NET Core runtime to create a new thread of execution to handle the task at hand?
async
What C# keyword makes the current thread be paused when an asynchronous method is called?
await
What type of method call do you have if you have a method decorated with the async keyword and it contains no internal await?
A synchronous method
If you have a Main() method in Program.cs that returns an int, and you want to decorate Main() with async, what will the new return type be?
Task<int>
What two keywords were added in .NET 4.5 that further simplified the process of writing asynchronous code?
async and await
What type does System.Threading provide to interact with the runtime thread pool?
ThreadPool
Previous card
First card
Random order
Next card