Multithreaded Programming MCQ C# Set– 2

Errorlogger
0
1. Which of these keywords are used to implement synchronization?
a) synchronize
b) syn
c) synch
d) synchronized



2. Which keyword is used for using the synchronization features defined by the Monitor class?
a) lock
b) synchronized
c) Monitor
d) locked



3. What is synchronization in reference to a thread?
a) Its a process of handling situations when two or more threads need access to a shared resource
b) Its a process by which many thread are able to access same shared resource simultaneously
c) Its a process by which a method is able to access many different threads simultaneously
d) Its a method that allow to many threads to access any information the require



4. Which method is called when a thread is blocked from running temporarily?
a) Pulse()
b) PulseAll()
c) Wait()
d) Both b & c



5. What kind of exception is being thrown if Wait(),Pulse() or PulseAll() iscalled from code that is not within synchronized code?
a) System I/O Exception
b) DivideByZero Exception
c) SynchronizationLockException
d) All of the mentioned



6. What is mutex?
a) a mutually exclusive synchronization object
b) can be acquired by more than one thread at a time
c) helps in sharing of resource which can be used by one thread at only one a time
d) All of the mentioned

e) both a and c


7. What is Semaphore?
a) Grant more than one thread access to a shared resource at the same time.
b) Useful when a collection of resources is being synchronized
c) Make use of a counter to control access to a shared resource
d) all of the above



8. Which method is used to abort thread prior to it’s normal execution?
a) sleep()
b) terminate()
c) suspend()
d) Abort()



9. Which of these statements is incorrect?
a) By multithreading CPU’s idle time is minimized, and we can take maximum use of it
b) By multitasking CPU’s idle time is minimized, and we can take maximum use of it
c) Two thread in Csharp can have same priority
d) A thread can exist only in two states, running and blocked



10. What is multithreaded programming?
a) It’s a process in which two different processes run simultaneously
b) It’s a process in which two or more parts of same process run simultaneously
c) Its a process in which many different process are able to access same information
d) Its a process in which a single process can access information from many sources

Tags

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(30)

Our website uses cookies to enhance your experience. Check Now
Accept !