System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 156
Q3461:
Using HeapCreate() allows each thread to have its own ________.
A. Stack
B. Heap
C. Memory cache
D. Global memory
Correct Answer:
B
Chapter: 156
Q3462:
Threads compete for resources such as CPU and ________.
A. Memory
B. Input devices
C. Network
D. Files
Correct Answer:
B
Chapter: 156
Q3463:
To improve performance in concurrent threads, competition for resources should be ________.
A. minimized
B. maximized
C. ignored
D. duplicated
Correct Answer:
A
Chapter: 156
Q3464:
Third-party APIs can be considered for managing ________ in concurrent threads.
A. Network access
B. Memory management
C. CPU scheduling
D. File handling
Correct Answer:
B
Chapter: 156
Q3465:
malloc() function allocates memory from the ________.
A. Stack
B. Heap
C. Register
D. Global memory
Correct Answer:
B
Chapter: 156
Q3466:
free() function is used to ________ dynamically allocated memory.
A. Allocate
B. Lock
C. Unlock
D. Deallocate
Correct Answer:
D
Chapter: 156
Q3467:
To allocate memory safely in multithreaded programs, HeapAlloc() should be used with a ________.
A. Heap handle
B. Thread ID
C. Process ID
D. Mutex
Correct Answer:
A
Chapter: 156
Q3468:
Which function is used to create a new heap in Windows threading?
A. HeapAlloc()
B. HeapCreate()
C. malloc()
D. free()
Correct Answer:
B
Chapter: 157
Q3469:
Synchronization can negatively impact ________.
A. security
B. application size
C. performance
D. user interface
Correct Answer:
C
Chapter: 157
Q3470:
Locking, waiting, and interlocked operations are considered ________.
A. fast
B. expensive
C. invisible
D. redundant
Correct Answer:
B
Chapter: 157
Q3471:
Waiting in synchronization involves ________.
A. CPU optimization
B. time sharing
C. expensive operations
D. parallel execution
Correct Answer:
C
Chapter: 157
Q3472:
Kernel operations are required for ________.
A. heap allocation
B. thread destruction
C. locking
D. garbage collection
Correct Answer:
C
Chapter: 157
Q3473:
One thread executing critical section at a time reduces ________.
A. data redundancy
B. concurrency
C. execution time
D. stack usage
Correct Answer:
B
Chapter: 157
Q3474:
Critical sections executed by a single thread cause ________.
A. full parallelism
B. partial buffering
C. almost serialization
D. excess memory usage
Correct Answer:
C
Chapter: 157
Q3475:
When multiple processes compete for memory and cache, ________ may occur.
A. performance optimization
B. unexpected effects
C. correct scheduling
D. smooth execution
Correct Answer:
B
Chapter: 157
Q3476:
Synchronization methods can cause delays due to ________.
A. redundant threads
B. parallelism
C. interlocked efficiency
D. locking and waiting
Correct Answer:
D
Chapter: 157
Q3477:
Only one ________ can execute a critical code section at a time.
A. thread
B. function
C. class
D. process
Correct Answer:
A
Chapter: 157
Q3478:
Locking in synchronization typically involves ________ operations.
A. user-level
B. kernel-level
C. inline
D. register-level
Correct Answer:
B
Chapter: 157
Q3479:
Waiting during synchronization is considered an ________ action.
A. expensive
B. invisible
C. automatic
D. irrelevant
Correct Answer:
A
Chapter: 157
Q3480:
Unexpected effects may arise when processes compete for ________.
A. stack space
B. input devices
C. disk space
D. memory and cache
Correct Answer:
D