Threads questions

Q24

GATE CS 2024 CS-1Processes and ThreadsMSQ1 mark
Which of the following statements about threads is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: D

Q22

GATE CS 2023 CSProcesses and ThreadsMSQ1 mark
Which one or more of the following need to be saved on a context switch from one thread (T1T_1) of a process to another thread (T2T_2) of the same process?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q42

GATE CS 2021 CS-2Processes and ThreadsMSQ2 marks
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 and T2:
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);}
Which of the following statement(s) is/are correct?
More than one option can be correct.
Show answer without attempting

Answer: A, D

Q18

GATE CS 2017 CS-1Processes and ThreadsMCQ1 mark−1/3 if wrong
Threads of a process share
Show answer without attempting

Answer: D

Q7

GATE CS 2017 CS-2Processes and ThreadsMCQ1 mark−1/3 if wrong
Which of the following is/are shared by all the threads in a process?

I. Program counter
II. Stack
III. Address space
IV. Registers
Show answer without attempting

Answer: B

Q20

GATE CS 2014 CS-1Processes and ThreadsMCQ1 mark−1/3 if wrong
Which one of the following is FALSE?
Show answer without attempting

Answer: D

0/60 correct0 marks

Related topics in Processes and Threads