31. What is the purpose of the Thread.Sleep() method in C# multithreading? A. To terminate the current thread immediately B. To synchronize access to a shared resource C. To signal one or more waiting threads that an event has occurred D. To pause the execution of the current thread for a specified amount of time Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
32. Which class is used to create a new thread in C#? A. Thread B. ThreadPool C. Task D. Executor Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
33. What does the term "context switching" refer to in multithreading? A. The process of joining multiple threads B. The process of terminating a thread C. The process of creating a new thread D. The process of saving and restoring the state of a thread so that it can be executed later Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
34. In C#, what is the purpose of the Thread.Join() method? A. To start a new thread B. To suspend the execution of the current thread C. To wait for a thread to finish its execution before continuing with the current thread D. To terminate the current thread Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
35. What is a thread pool in C# multithreading? A. A mechanism for synchronizing access to shared resources B. A collection of pre-initialized threads that are available for executing tasks C. A mechanism for handling exceptions thrown by threads D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
36. What is the purpose of the Monitor.Enter() and Monitor.Exit() methods in C#? A. To acquire and release an exclusive lock on an object B. To create a new thread C. To pause and resume the execution of a thread D. To terminate a thread Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
37. Which statement is true regarding thread safety in C#? A. Thread safety prevents the creation of new threads B. Thread safety guarantees that threads always execute in parallel C. Thread safety ensures that only one thread can access a resource at a time D. A thread-safe code can be accessed by multiple threads concurrently without causing any issues Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
38. What is the purpose of the Thread.Abort() method in C#? A. To wait for a thread to finish its execution before continuing with the current thread B. To synchronize access to a shared resource C. To terminate the current thread immediately D. To signal one or more waiting threads that an event has occurred Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
39. What is a deadlock in multithreading? A. A condition where a thread blocks the execution of other threads B. A situation where two or more threads are blocked indefinitely, waiting for each other to release resources C. A condition that occurs when two or more threads access shared data and attempt to modify it at the same time D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
40. What is the purpose of the Thread.IsBackground property in C#? A. It waits for a thread to finish its execution before continuing with the current thread B. It suspends the execution of the thread C. It determines whether a thread is a background thread or a foreground thread D. It specifies the priority of the thread Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board