QUIZ-2
pdf
keyboard_arrow_up
School
Arizona State University *
*We aren’t endorsed by this school
Course
330
Subject
Philosophy
Date
Apr 3, 2024
Type
Pages
8
Uploaded by ConstableNeutron28718
Question 1
1 pts
What is inter-process communication (IPC)?
Group of answer choices
The process of sharing memory between processes
The process of creating multiple threads within a process
A mechanism for processes to communicate and synchronize their actions
The act of sharing files between processes
Flag question: Question 2
Question 2
1 pts
What is the primary purpose of a mutex in multithreading?
Group of answer choices
To wait on a condition variable
To create a new thread
To lock a critical section to achieve mutual exclusion
To destroy a thread
Flag question: Question 3
Question 3
1 pts
Which hardware instruction can be used to achieve mutual exclusion in
multithreading?
Group of answer choices
Load
Jump
TestAndSet (TAS)
Store
Flag question: Question 4
Question 4
1 pts
What does the term "atomic operation" mean in the context of multithreading?
Group of answer choices
An operation that only works on atomic clocks
An operation that executes simultaneously on all threads
An operation that completes in its entirety without interruption
An operation that involves atoms
Flag question: Question 5
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Question 5
1 pts
What does the
sem_init(&s, 0, 1)
statement initialize the semaphore
s
to?
Group of answer choices
The value 1
The value 0
The value -1
The value 2
Flag question: Question 6
Question 6
1 pts
In the producer-consumer problem with semaphores, what does the
empty
semaphore represent?
Group of answer choices
The number of items in the buffer
The number of empty buffers
The number of full buffers
The number of consumers
Flag question: Question 7
Question 7
1 pts
Which of the following operations is used to increment the value of a
semaphore?
Group of answer choices
sem_signal
sem_post
sem_release
sem_wait
Flag question: Question 8
Question 8
1 pts
In the context of condition variables, what is a common issue to be aware of
when using
signal
and
wait
operations?
Group of answer choices
Deadlock
Busy waiting
Lost signals if nobody is waiting
Priority inversion
Flag question: Question 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Question 9
1 pts
In the Readers-Writers problem, what is the primary difference between readers
and writers in terms of access?
Group of answer choices
Readers always have higher priority over writers.
Writers always have higher priority over readers.
Readers can modify shared data, while writers can only read it.
Any number of readers can read concurrently, while only one writer can write at
a time.
Flag question: Question 10
Question 10
1 pts
What is the purpose of the Dining Philosophers problem?
Group of answer choices
To demonstrate challenge of access to shared resources for multiple
consumers.
To simulate a dinner party with philosophers.
To demonstrate the concept of circular wait.
To find an efficient way for philosophers to eat noodles.