Mod 3.2 Operating Systems

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/22

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

23 Terms

1
New cards
  • Bounded-Buffer Problem

  • Readers and Writers Problem

  • Dining-Philosophers Problem

What are the classical problems of Synchronization

2
New cards

Bounded-Buffer Problem

  • n buffers, each can hold one item

  • Semaphore mutex initialized to the value 1

  • Semaphore full initialized to the value 0

  • Semaphore empty initialized to the value n

3
New cards

Readers

In Readers-Writers Problem they are the ones who only read the data set; they do not perform any updates

4
New cards

Writers

In Readers-Writers Problem they are the ones who can both read and write

5
New cards

Readers-Writers Problem

  • Problem – allow multiple readers to read at the same time

    • Only one single writer can access the shared data at the same time

6
New cards

“First reader-writer”

A situation where a writer process never writes.

7
New cards
  • Once a writer is ready to write, no “newly arrived reader” is allowed to read.

8
New cards

Starvation

Both the First reader-writer and Second reader-writer may result in

9
New cards

Readers-Writers Problem

10
New cards

Dining-Philosophers Problem


  • N philosophers’ sit at a round table with a bowl of rice in the middle.

  • They spend their lives alternating thinking and eating. 

  • They do not interact with their neighbors. 

  • Occasionally try to pick up 2 chopsticks (one at a time) to eat from bowl

    • Need both to eat, then release both when done

11
New cards

Kernel Synchronization - Windows uses _____ protect access to global resources on uniprocessor systems

12
New cards

spinlocks

Kernel Synchronization - Windows uses _____ on multiprocessor systems

13
New cards

dispatcher objects

Kernel Synchronization - Windows provides user land which may act mutexes, semaphores, events, and timers

14
New cards

Linux Synchronization

On single-CPU system, spinlocks replaced by enabling and disabling kernel preemption

15
New cards

True

True or False

  • Linux provides:

    • Semaphores

    • Atomic integers

    • Spinlocks

    • Reader-writer versions of both

16
New cards

POSIX Synchronization

Widely used on UNIX, Linux, and macOS

17
New cards

True

True or False:

  • POSIX API provides

    • mutex locks

    • semaphores

    • condition variable

18
New cards

True

True or False:

  • Java provides rich set of synchronization features:

    • Java monitors

    • Reentrant locks

    • Semaphores

    • Condition variables

19
New cards

Single lock

Every Java object has associated with it a?

20
New cards

Synchronized

If a method is declared as ___ a calling thread must own the lock for the object.

21
New cards

True

True or False

  • If the lock is owned by another thread, the calling thread must wait for the lock until it is released.

22
New cards

Functional programming languages

offer a different paradigm than procedural languages in that they do not maintain state.

23
New cards

Variables

treated as immutable and cannot change state once they have been assigned a value.