OS Processes & Concurrency

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

1/30

flashcard set

Earn XP

Description and Tags

concepts ranging from HWs 1&2; Quiz 0&1; Lab 0

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

31 Terms

1
New cards

What is a process?

an instance of a running program that is an abstraction of the operating system

2
New cards

What is the importance of having certain operations like read() and write() managed by the operating system instead of individual processes?

1. Prevent user level processes from manipulating hardware 2. Program will have good portability across machines 3. Processes do not have to have redundant code

3
New cards

what are the three aspects to a process?

4
New cards

what is the operating system?

the system software that manages hardware/software resources to ensure efficiency

5
New cards

how would you examine the assembly code of a program in your terminal?

gcc -S the_source_file.c -o the_assembly_file.s

6
New cards

what is virtualization?

the process of the OS creating virtual versions of computer hardware

7
New cards

how does a process access system resources?

it does a system call

8
New cards

what is a system call?

the mechanism by which user-level programs ask the OS to do things for them

9
New cards

what is the kernel?

the core part of the OS that bridges the software and hardware

10
New cards

what are the disadvantages of user mode?

no direct access to system resources, kernel programs, nor memory not manually allocated in user mode

11
New cards

what are the advantages of kernel mode?

unrestricted access to system resources, user and kernel programs, and memory blocks

12
New cards

what are the three ways to invoke the kernel?

system call, exception call, interrupt call

13
New cards

what is a PID?

the unique process identifier of the running program.

14
New cards

how do you create a new process?

fork()

15
New cards

what are the 3 main purposes of the OS?

  1. takes physical resources and virtualizes them

  2. handles concurrency

  3. stores files consistently

16
New cards

what is concurrency?

the ability to execute multiple threads and processes simultaneously

17
New cards

how to create a thread?

pthread.create()

18
New cards

what type does fork return?

the pid_t of the child process is returned in the parent, and 0 is returned in the child

19
New cards

what if fork returns -1?

the system call failed

20
New cards

what does the child process inherit from the parent process?

program code, program counter, memory, opened files

21
New cards

what deviates between child and parent process?

different ret value, pid, parent, running time, file lock

22
New cards

if the child process is a duplicate of the program the parent process comes from, why wouldn’t this result in infinite creation of processes?

the child has the same code but only executes code after the initial fork line

23
New cards

who runs first between parent and child?

that depends on process scheduling

24
New cards

how can we ensure a child process is done first?

wait()

25
New cards

what is the shell?

program that creates programs and lets users interact with the kernel, usually via command-line

26
New cards

what is process control block

data struct where OS keeps information about a process

27
New cards

How does the operating system create the illusion that every process has its own private set of CPU registers? 

the kernel saves registers of current process in its PCB before switching to another process

28
New cards

what does PCB have:

the pid, state, user id, ip, opened files, open files, VM structs, registers

29
New cards

what is time sharing:

the act of concurrent processes being executed through virtualization via PCB to cut down runtime

30
New cards

what is context switch

the act of switching between processes using PCB

31
New cards

what is zombie state

a child has exited, but the parent isn't given its exit status so the OS doesn't cleanup its PCB