Exams Net
Unrestricted Exams Practice
Home
Exams
Banking
CUET
Defence
Engineering
Finance
GATE
Insurance
International
JEE
LAW
MBA
MCA
Medical
Other
Police
PSC
RRB
SSC
State Govt
Subjectwise
Teacher
SET Exams
UPSC
Aptitude
Algebra and Higher Mathematics
Arithmetic
Commercial Mathematics
Data Based Mathematics
Geometry and Mensuration
Number System and Numeracy
Problem Solving
Board Exams
Andhra
Bihar
CBSE
Gujarat
Haryana
ICSE
Jammu and Kashmir
Karnataka
Kerala
Madhya Pradesh
Maharashtra
Odisha
Tamil Nadu
Telangana
Uttar Pradesh
English
Competitive English
CBSE
CBSE Class 10 Solutions
CBSE Class 12 Solutions
CBSE Question Papers (Pdf)
NCERT Books (Pdf)
NCERT Exemplar Books (Pdf)
NCERT Study Notes (Pdf)
CBSE Study Concepts (Pdf)
NCERT Text Book Class 11 Solutions
NCERT Text Book Class 12 Solutions
ICSE Class 10 Papers
Certifications
Technical
Cloud Tech Certifications
Security Tech Certifications
Management
IT Infrastructure
More
About
Contact Us
Our Apps
Privacy
+
-
Default
Dark
Blue
Green
Violet
Crimson
Red
Cafe
Gold
Orange
Olive
Grey
Test Index
GATE Computer Science (CS) 2022 Shift 1 Solved Paper
Show Para
Hide Para
Share question:
© examsnet.com
Question : 19 of 65
Marks:
+1
,
-0
Consider the following threads, T1, T2, and T3 executing on a single processor, synchronized using three binary semaphore variables, S1, S2, and S3, operated upon using standard wait() and signal(). The threads can be context switched in any order and at any time.
T1
T2
T3
While(true) {
Wait(S3);
Print(“C”);
Signal (S2); }
While(true) {
Wait(S1);
Print(“B”);
Signal (S3); }
While(true) {
Wait(S2);
Print(“A”);
Signal (S1); }
Which initialization of the semaphores would print the sequence BCABCABCA….?
S
1
= 1; S
2
= 1; S
3
= 1
S1 = 1; S2 = 1; S3 = 0
S1 = 1; S2 = 0; S3 = 0
S1 = 0; S2 = 1; S3 = 1
Validate
Go to Question:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Prev Question
Next Question
More Free Exams
GATE Civil Engineering Previous Papers
GATE Electrical Engineering Previous
GATE Electronic & Communications Previous
GATE Mechanical Engineering Previous
GMAT Exam Practice Tests
GRE Practice Tests