Q14
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
More than one option can be correct.
Show answer without attempting
Answer: A, C
GATE CS · Operating Systems · 2 questions
2 Processes and Threads questions from GATE CS papers (2021), each with the official answer key. Part of Operating Systems. Answer any question right here and it is marked straight away, or practise them one at a time.
Answer: A, C
int x = 0; // global
Lock L1; // global
main() {
create a thread to execute foo(); // Thread T1
create a thread to execute foo(); // Thread T2
wait for the two threads to finish execution;
print (x);}
foo() {
int y = 0;
Acquire L1;
x = x + 1;
y = y + 1;
Release L1;
print (y);}Answer: A, D
0/20 correct0 marks