System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 116
Q2521:
WaitForMultipleObjects() can wait for a maximum of ______ objects at a time.
A. 32
B. 64
C. 128
D. 256
Correct Answer:
B
Chapter: 116
Q2522:
If there are 100 objects to wait for, how many calls to WaitForMultipleObjects() are needed?
A. 1
B. 2
C. 3
D. 4
Correct Answer:
B
Chapter: 116
Q2523:
The wait function waits for the object handle to become ______.
A. signaled
B. running
C. suspended
D. terminated
Correct Answer:
A
Chapter: 116
Q2524:
ExitThread() sets the thread object to the ______ state.
A. signaled
B. suspended
C. running
D. terminated
Correct Answer:
A
Chapter: 116
Q2525:
TerminateThread() releases all other threads waiting on the thread object by setting it to ______.
A. signaled
B. suspended
C. running
D. terminated
Correct Answer:
A
Chapter: 116
Q2526:
Multiple threads can wait on the ______ object.
A. same
B. different
C. unique
D. none
Correct Answer:
A
Chapter: 116
Q2527:
ExitProcess() sets the process state and the state of all its threads to ______.
A. signaled
B. suspended
C. running
D. terminated
Correct Answer:
A
Chapter: 116
Q2528:
WaitForMultipleObjects() takes the objects in the form of a(n) ______.
A. array
B. pointer
C. structure
D. queue
Correct Answer:
A
Chapter: 116
Q2529:
Waiting on a thread handle to become signaled means waiting for the thread to ______.
A. start
B. running
C. terminate
D. block
Correct Answer:
B
Chapter: 116
Q2530:
To wait for a thread to finish, you should use ______ function with the thread handle.
A. ExitThread()
B. WaitForSingleObject()
C. TerminateThread()
D. SuspendThread()
Correct Answer:
B
Chapter: 116
Q2531:
Threads and actions should be synchronized so that action can be performed after ______ execution.
A. process
B. thread
C. thread termination
D. thread start
Correct Answer:
C
Chapter: 117
Q2532:
Which C library function is used to extract tokens from a string but is not thread-safe?
A. strtok()
B. strtok_s()
C. strtok_r()
D. strtok_safe()
Correct Answer:
A
Chapter: 117
Q2533:
The problem of thread safety arises because strtok() uses ______ memory space for processing.
A. local
B. global
C. heap
D. stack
Correct Answer:
B
Chapter: 117
Q2534:
Thread safety issues when using strtok() can cause results to be ______.
A. accurate
B. compromised
C. optimized
D. consistent
Correct Answer:
B
Chapter: 117
Q2535:
LIBCMT is a ______ provided by Windows C for thread-safe C library functions.
A. thread-safe library
B. debugging tool
C. compiler
D. IDE
Correct Answer:
A
Chapter: 117
Q2536:
The equivalent of CreateThread() in the C library is ______.
A. _beginthreadex()
B. _endthreadex()
C. CreateProcess()
D. ExitThread()
Correct Answer:
A
Chapter: 117
Q2537:
The function used to end a thread in C library threading is ______.
A. _beginthreadex()
B. _endthreadex()
C. ExitThread()
D. CreateThread()
Correct Answer:
B
Chapter: 117
Q2538:
_beginthreadex() does not allow users to specify ______.
A. return values
B. security attributes
C. thread ID
D. stack size
Correct Answer:
B
Chapter: 117
Q2539:
_endthreadex() does not allow ______.
A. return values
B. thread creation
C. thread termination
D. thread status passing
Correct Answer:
D
Chapter: 117
Q2540:
When using _beginthreadex() in a Windows program, its return value must be typecast to ______ to process further.
A. DWORD
B. HANDLE
C. int
D. BOOL
Correct Answer:
B