CS-3310 - 02 Processes - Concurrency

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/48

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.

49 Terms

1
New cards

thread

like a process with shared memory and resources

2
New cards

How does the OS keep track of threads?

thread control block

3
New cards

Threads have individual (or thread-local) ____

stacks

4
New cards

Transforming a single-threaded program into a program that does work on multiple CPUs

parallelization

5
New cards

Why parallelization?

avoid blocking from I/O

6
New cards

Processes across programs

multiprocessing

7
New cards

Because of the unpredictability of the scheduler, the result of a multithreaded program is

non-deterministic

8
New cards

Non-deterministic output is due to

race conditions

9
New cards

Race condition (or data race)

multiple threads updating the same data

10
New cards

Portion of code that accesses a shared resources

critical section

11
New cards

Preventing other threads from executing the same section of code as the current one

mutual exclusion

12
New cards

Instruction that runs completely, or not at all

atomic instruction

13
New cards

Indeterminate program

involves at least one race condition

14
New cards

Allows critical sections to be run atomically

lock

15
New cards

Lock states

free, held

16
New cards

Thread that has acquired a lock

owner thread

17
New cards

Single lock for all critical sections

coarse-grained

18
New cards

Multiple locks for different data

fine-grained

19
New cards

Requirements for solution to the critical section problem

mutual exclusion, progress, bounded waiting

20
New cards

Spin-wait

do nothing until a condition is met

21
New cards

Simple hardware support for spin lock

test-and-set/atomic exchange

22
New cards

test-and-set

atomically get value from pointer and set memory location to new value

23
New cards

Spin lock requires a ____ scheduler

preemptive

24
New cards

Different simple primitive instruction - more flexible, compares with expected value

compare-and-exchange

25
New cards

compare-and-exchange

test if value is expected; if so, update to new value

26
New cards

yield

moves caller from running to ready

27
New cards

True/false: a while loop is still necessary with yield

true

28
New cards

Linux fast locking mechanism

futex

29
New cards

Two-phase lock phases

spin, sleep if unsuccessful

30
New cards

Condition variable

queue for threads waiting on some condition

31
New cards

How are threads woken from waiting on a condition variable?

another thread signaling

32
New cards

Always use a ____ variable when using a condition variable

state

33
New cards

One or more producer threads and one or more consumer threads with a shared buffer

bounded buffer problem

34
New cards

Always use ____ ____ with condition variables to recheck the condition every time a signal happens

while loops

35
New cards

Integer value with down and up routines

semaphore

36
New cards

Semaphore down routine

sem_wait

37
New cards

Semaphore up routine

sem_post

38
New cards

sem_wait

decrement then block if negative

39
New cards

sem_post

increment then wake a sleeping thread

40
New cards

Binary semaphore

semaphore used as a lock

41
New cards

Language construct supported by the compiler that provides mutual exclusion

monitor

42
New cards

Java monitor keyword

synchronized

43
New cards

Design issues with message passing

message loss, process naming, authentication

44
New cards

Mailbox

data structure that buffers messages

45
New cards

Message passing strategy with no message buffer

rendezvous

46
New cards

Synchronization method for groups of processes where all processes finish phase before any move on

barrier

47
New cards

Common barrier application

matrix operations

48
New cards

IPC

inter-process communication

49
New cards