Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 112
Q2481:
The function passed to CreateThread() usually has the form: DWORD WINAPI ______ (LPVOID).
A. ThreadFunc
B. ThreadMain
C. ThreadStart
D. ThreadBegin
Correct Answer: A
Chapter: 112
Q2482:
The thread function returns a ______ value, usually an exit code.
A. DWORD
B. int
C. VOID
D. BOOL
Correct Answer: A
Chapter: 112
Q2483:
dwCreationFlags = 0 means the thread will start ______.
A. immediately
B. later
C. suspended
D. stopped
Correct Answer: A
Chapter: 112
Q2484:
If dwCreationFlags is CREATE_SUSPENDED, the thread will be ______ initially.
A. stopped
B. suspended
C. running
D. waiting
Correct Answer: B
Chapter: 112
Q2485:
The thread can be started after suspension by calling ______.
A. ResumeThread()
B. StartThread()
C. BeginThread()
D. RunThread()
Correct Answer: A
Chapter: 112
Q2486:
lpThreadId in CreateThread() is a pointer to a DWORD that receives the thread ______.
A. identifier
B. value
C. address
D. stack
Correct Answer: A
Chapter: 112
Q2487:
If lpThreadId is kept NULL, then the thread ______ will not be returned.
A. identifier
B. return
C. value
D. status
Correct Answer: A
Chapter: 112
Q2488:
CreateThread() returns a ______ which can be used to manage the thread.
A. HANDLE
B. THREAD
C. PROCESS
D. OBJECT
Correct Answer: A
Chapter: 112
Q2489:
The lpParameter argument in CreateThread() usually points to a ______ containing arguments.
A. structure
B. class
C. method
D. variable
Correct Answer: A
Chapter: 113
Q2490:
Which function is used by a thread to exit and provide an exit code?
A. ExitProcess()
B. ExitThread()
C. TerminateThread()
D. CloseThread()
Correct Answer: B
Chapter: 113
Q2491:
When a thread exits, its thread stack is ______.
A. deallocated
B. shared
C. preserved
D. reinitialized
Correct Answer: A
Chapter: 113
Q2492:
When a thread exits and is linked to a DLL, which function is called with DLL_THREAD_DETACH reason?
A. DllMain()
B. DllAttach()
C. DllDetach()
D. DllExit()
Correct Answer: A
Chapter: 113
Q2493:
The ExitThread() function accepts an argument called ______.
A. exit code
B. thread ID
C. priority
D. handle
Correct Answer: A
Chapter: 113
Q2494:
When all threads in a process exit, the process will ______.
A. continue
B. wait
C. terminate
D. restart
Correct Answer: C
Chapter: 113
Q2495:
Which function can be used by one thread to forcibly terminate another thread?
A. KillThread()
B. TerminateThread()
C. StopThread()
D. EndThread()
Correct Answer: B
Chapter: 113
Q2496:
Using TerminateThread() is ______ because it does not deallocate resources or notify DLLs.
A. recommended
B. discouraged
C. required
D. optional
Correct Answer: B
Chapter: 113
Q2497:
After a thread’s execution ends, the thread object exists until ______ is called.
A. CloseHandle()
B. ExitThread()
C. TerminateThread()
D. FreeThread()
Correct Answer: A
Chapter: 113
Q2498:
The function to retrieve a thread’s exit code is ______.
A. GetThreadExitCode()
B. GetExitCodeThread()
C. ExitCodeGet()
D. ThreadExitCodeGet()
Correct Answer: B
Chapter: 113
Q2499:
CloseHandle() is used to destroy the last ______ to a thread object.
A. reference
B. handle
C. stack
D. memory
Correct Answer: B
Chapter: 114
Q2500:
Which function returns a non-inheritable pseudohandle to the calling thread?
A. GetThreadId()
B. GetCurrentThreadId()
C. GetCurrentThread()
D. OpenThread()
Correct Answer: C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now