Process Synchronization

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:10 AM on 3/15/24
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

11 Terms

1
New cards

How does atomic execution and critical sections work?

Places that require atomic executions are called critical sections and this is where execution of code by only a single thread happens

2
New cards

What are the 3 forms of synchronization?

  1. Mutex

  2. Semaphores

  3. Monitors

3
New cards

What are the calls for Mutex?

acquire and release

4
New cards
<p>What would this code look like if we added Mutex code?</p>

What would this code look like if we added Mutex code?

knowt flashcard image
5
New cards

What is the disadvantage of using a mutex compared to a semaphore?

Mutex locks only allow one thread to use the critical section

6
New cards

What are the calls for Semaphores?

wait and release

7
New cards

When using semaphores, when can you access a critical section?

When S is greater than 0

8
New cards

When does a semaphore increment and decrement?

Decrements when the thread enters the critical section and increments when the thread leaves the critical section

9
New cards

What is the disadvantage of using busy waiting in Semaphores?

It wastes CPU cycles

10
New cards
<p>What would the code look like?</p><ul><li><p>a1 has to happen before b2</p></li><li><p>b1 has to happen before a2</p></li><li><p>(Use more than one semaphore)</p></li></ul><p>Will this cause a deadlock? Why?</p>

What would the code look like?

  • a1 has to happen before b2

  • b1 has to happen before a2

  • (Use more than one semaphore)

Will this cause a deadlock? Why?

Yes, because both threads will be at -1

<p>Yes, because both threads will be at -1</p>
11
New cards

Why does a mutex need a lock holder pointer but semaphores don’t?

Because in a mutex, only the lock holder can release the lock. In a semaphore, threads using increment could be different than those using decrement

Explore top flashcards

Los retrato vocab
Updated 1170d ago
flashcards Flashcards (23)
Kapitel 4
Updated 1115d ago
flashcards Flashcards (69)
Unit 1 Chem
Updated 383d ago
flashcards Flashcards (69)
Bio 2 e-ipsi
Updated 58d ago
flashcards Flashcards (22)
TECTONICS
Updated 638d ago
flashcards Flashcards (40)
Los retrato vocab
Updated 1170d ago
flashcards Flashcards (23)
Kapitel 4
Updated 1115d ago
flashcards Flashcards (69)
Unit 1 Chem
Updated 383d ago
flashcards Flashcards (69)
Bio 2 e-ipsi
Updated 58d ago
flashcards Flashcards (22)
TECTONICS
Updated 638d ago
flashcards Flashcards (40)