System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 135
Q2881:
InterlockedIncrement() takes a parameter of type ________.
A. int*
B. LONG volatile*
C. char*
D. double*
Correct Answer:
B
Chapter: 135
Q2882:
The variable used with InterlockedIncrement() must be stored at a ________.
A. 1-byte boundary
B. 2-byte boundary
C. 4-byte boundary
D. 16-byte boundary
Correct Answer:
C
Chapter: 135
Q2883:
InterlockedIncrement64() is used in ________ systems.
A. 8-bit
B. 16-bit
C. 32-bit
D. 64-bit
Correct Answer:
D
Chapter: 135
Q2884:
For 64-bit interlocked functions, the variable should be stored at ________.
A. 4-byte boundary
B. 2-byte boundary
C. 8-byte boundary
D. 1-byte boundary
Correct Answer:
C
Chapter: 135
Q2885:
The function InterlockedDecrement(&N) will ________.
A. delete N
B. return N*2
C. decrement N and return new value
D. print N
Correct Answer:
C
Chapter: 135
Q2886:
Interlocked functions work on variables declared as ________.
A. static
B. local
C. volatile
D. global
Correct Answer:
C
Chapter: 135
Q2887:
Using InterlockedIncrement() twice to increase value by 2 is ________.
A. recommended
B. unreliable
C. required
D. optimal
Correct Answer:
B
Chapter: 135
Q2888:
Which function is used to safely increase a variable by more than one atomically?
A. InterlockedIncrement()
B. InterlockedFlush()
C. InterlockedExchangeAdd()
D. InterlockedDelay()
Correct Answer:
C
Chapter: 135
Q2889:
Interlocked functions ensure atomicity in ________.
A. thread scheduling
B. arithmetic on volatile variables
C. memory paging
D. file access
Correct Answer:
B
Chapter: 135
Q2890:
The value of N can be changed by another thread ________ the Interlocked function returns.
A. before
B. after
C. while
D. all of these
Correct Answer:
D
Chapter: 135
Q2891:
InterlockedExchangeAdd() helps avoid preemption between ________.
A. memory allocations
B. increment steps
C. function declarations
D. file I/O
Correct Answer:
B
Chapter: 135
Q2892:
Interlocked functions are ________ to use in multi-threaded environments.
A. discouraged
B. illegal
C. complex
D. simple and fast
Correct Answer:
D
Chapter: 135
Q2893:
The return value of InterlockedIncrement() is the ________ value of the variable.
A. original
B. current
C. new
D. previous
Correct Answer:
C
Chapter: 135
Q2894:
Interlocked functions are declared to operate on variables of type ________.
A. unsigned short
B. double
C. LONG volatile
D. char*
Correct Answer:
C
Chapter: 135
Q2895:
Volatile variables ensure visibility of updated values across ________.
A. registers
B. threads
C. disk
D. buffers
Correct Answer:
B
Chapter: 135
Q2896:
InterlockedIncrement(&N); assumes that N is a ________ variable.
A. static
B. volatile integer
C. unsigned char
D. float
Correct Answer:
B
Chapter: 135
Q2897:
Interlocked functions improve performance by avoiding ________.
A. multithreading
B. memory leaks
C. complex locking mechanisms
D. type casting
Correct Answer:
C
Chapter: 135
Q2898:
InterlockedIncrement() and InterlockedDecrement() return values of type ________.
A. char
B. double
C. LONG
D. BOOL
Correct Answer:
C
Chapter: 135
Q2899:
Memory barriers help ensure proper sequence of ________ in multiprocessor systems.
A. threads
B. instructions
C. cache loads
D. memory operations
Correct Answer:
D
Chapter: 135
Q2900:
Calling InterlockedIncrement(&N) twice in sequence may lead to ________.
A. accurate increment by 2
B. synchronization
C. thread preemption issues
D. compiler error
Correct Answer:
C