System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q2611: What is the purpose of the 'threadArg' structure?
- A: Stores thread return values
- B: Passes thread number and record range
- C: Manages memory allocation
- D: Handles error reporting
View Answer
B
Q2612: What does the program do if the input file cannot be opened?
- A: Creates a new file
- B: Prints an error and exits
- C: Ignores error
- D: Retries opening file
View Answer
B
Q2613: The file is sorted in place, meaning:
- A: The original file is replaced
- B: A new file is created
- C: Sorting is done in memory
- D: Sorting is done on disk
View Answer
C
Q2614: How does the program handle printing the sorted file?
- A: Writes to console
- B: Saves to new file
- C: Prints all records as string
- D: Sends to network
View Answer
C
Q2615: What does the variable 'nRecTh' represent in the program?
- A: Number of threads
- B: Number of records per thread
- C: Total number of records
- D: Number of processors
View Answer
B
Q2616: What function is used to create new threads suspended initially?
- A: CreateThread
- B: _beginthreadex
- C: ResumeThread
- D: WaitForSingleObject
View Answer
B
Q2617: What synchronization method is used to wait for thread completion before merging?
- A: Sleep
- B: WaitForSingleObject
- C: Mutex lock
- D: Critical section
View Answer
B
Q2618: When merging arrays, what is used to store temporary merged data?
- A: Static array
- B: Dynamically allocated memory
- C: File buffer
- D: Thread stack
View Answer
B
Q2619: What is the reason for restoring file length at the end of the program?
- A: To remove extra bytes added earlier
- B: To resize file for new data
- C: To prevent file corruption
- D: To reset file pointer
View Answer
A
Q2620: If memory is insufficient, what problem might occur during multithreaded sorting?
- A: Threads crash
- B: Performance degrades due to contention
- C: Incorrect results
- D: Deadlock
View Answer
B