Computing Systems W8 part 2 Flashcards

1
Q

Program vs process

A

program (passive) & process (active)

process:
instance of a program
requires resources (CPU, memory, IO, data)
program counter for execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

process resources (5)

A

CPU, memory, I/O , files, data

reusable resources are reclaimed when process terminates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

single-threaded process manager

A

one program counter : executes one instruction at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

multi-threaded process manager

A

multiple program counters for parallel execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Parallel execution

A

simultaneous execution of multiple processes or threads, typically on multiple CPU cores or processors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

concurrent execution

A

operating system switches between processes, giving the illusion of simultaneous execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Process management activities (4)

A

Creating/Deleting user & system processes
Stopping/Starting processes
process synchronization & communication
Deadlock handling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

process synchronization (3)

A

control multiple processes (threads) to preserves system integrity and avoids undesirable outcomes

Ensures only one process can access a shared resource at a time

Facilitates interaction between processes

Controls the order of execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

deadlock

A

two or more processes are unable to proceed because each is waiting for the other to release a resource, resulting in a cyclic waiting scenario.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Memory Management (3)

A

Keep track of currently used memory

Decides which process and data move in/out of memory

allocates/deallocate memory space as need

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Program execution and Memory

A

Memory must contain ALL program instructions in order to execute the program

data required by the program must be in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Memory management advantages

A

improve CPU utilization and computer response speed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

file

A

Standardized model that represents a collection of related information.

Users work with files and OS translates file operations into operations on storage devices

ex. files represent programs and data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Storage management (4)

A

OS provides users with file system to view information. Users interact with files (logical storage units)

create/delete files & directories
support for manipulating files/directories
Mapping files to mass storage
Backing up files on nonvolatile storage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Storage device properties (4)

A

speed (fast access to data)
capacity (big or small)
data-transfer rate (efficiency)
access method (how data is accessed, in order or random)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Mass Storage Management (3)

A

Computer speed and efficiency depends on mass storage system and management algorithms

Free-space management
Storage allocation
Disk scheduling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Mass Storage

A

Used for data that is meant to be kept for long periods. Used frequently so it must be efficient

ex.
secondary: HDD, SSD
tertiary: optical storage, magnetic tape (not as efficient)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

I/O subsystem components (3)

A

Memory management of I/O
- buffer (storage)
- caching
- spooling (I/O data is first spooled into a local buffer before sending data to output device)
- device driver interface
- Drivers for specific hardware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

protection

A

any mechanism for controlling access of processes or users to resources defined by the OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

security

A

defense of the system against internal and external attacks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

UserID

A

When user logs in to the system, the authentication determines user ID for the user. That user ID is associated with all of the user’s processes and threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

GroupID

A

ID to distinguish among sets of users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

escalate privileges

A

allows user to change to effective ID with more rights

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Cloud computing

A

delivers computing, storage, and applications as a service across a network (extension of virtualization)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Virtualization

A

Multiple simulated (virtual) versions of something on a single physical system

ex. Virtual Machine is like a computer within a computer. Multiple virtual machines on one physical machine, each with its own OS and applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Software as a service (SaaS)

A

one or more applications available via the internet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Platform as a service

A

software stack ready for application use via internet (i.e. database server)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Infrastructure as a Service (IaaS)

A

servers or storage available over internet (i.e. storage available for backup use)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

load balancers

A

spread traffic across multiple applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Real-time embedded systems

A

systems integrated into other devices that focus on real-time processing. Designed to perform specific tasks with a focus on meeting strict time constraints

constraints
- processes must be executed within specific time limits

i.e. sound system of computer

31
Q

command interpreter

A

Also known as CLI (when there are multiple it is called shell)

provides direct command entry (can be implemented by kernel or system program)

(UNIX) fetches command from user and CLI identify file to be loaded into memory and execute command

ex bash, C shell, Korn shell

32
Q

User OS Interface GUI

A

Graphical User Interface
rather than entering commands
directly via a command-line interface, users employ a mouse-based window-and-menu system characterized by a desktop metaphor

ex. mouse, keyboard, monitor

33
Q

System call

A

Allows user programs to request services from OS

provide an interface to the system calls available by OS. Access by programs via API (Win32, POSIX, Java API)

These calls are generally available as functions written in C and
C++, although certain low-level tasks

34
Q

System-call interface

A

Intercepts function calls in API and invokes system call

System call table indexed according to system call number

invokes a system call in OS kernel and return status of system call + return values

35
Q

System call types (6)

A

Process control
file management
device management
information maintenance
communications
protection

36
Q

Process control system call (5)

A

◦ create process, terminate process
◦ load, execute
◦ get process attributes, set process attributes
◦ wait event, signal event
◦ allocate and free memory

ex.
CreateProcess() fork()
ExitProcess() exit()
WaitForSingleObject()

37
Q

file management system call (4)

A

◦ create file, delete file
◦ open, close
◦ read, write, reposition
◦ get file attributes, set file attributes

ex.
CreateFile()
ReadFile()
WriteFile()
CloseHandle()

38
Q

device management system call (4)

A

request device, release device
◦ read, write, reposition
◦ get device attributes, set device attributes
◦ logically attach or detach devices

ex.
SetConsoleMode() ioctl()
ReadConsole() read()
WriteConsole()

39
Q

information maintenance system call (4)

A

◦ get time or date, set time or date
◦ get system data, set system data
◦ get process, file, or device attributes
◦ set process, file, or device attributes

ex.
GetCurrentProcessID() getpid()
SetTimer() alarm()
Sleep()

40
Q

communications system call (4)

A

◦ create, delete communication connection
◦ send, receive messages
◦ transfer status information
◦ attach or detach remote devices

ex.
CreatePipe() pipe()
CreateFileMapping() shm open()
MapViewOfFile()

41
Q

protection system call (2)

A

◦ get file permissions
◦ set file permissions

ex.
SetFileSecurity() chmod()
InitlializeSecurityDescriptor() umask()
SetSecurityDescriptorGroup()

42
Q

System programs

A

provide an environment for program development and execution. Provides essential services without direct user interaction

ex. user interface to system calls
file management: create, delete, copy, remain

43
Q

System call process

A
  • User program initiates system call
  • Mode switches to kernel mode
  • Control is transferred to specific system call function
  • Validation takes place to ensure user program has permissions to perform request
  • System call executes
  • After completing, handler returns results to user program
  • Control returns to user mode and it continue execution
44
Q

System programs characteristic

A

Some launched during system boot up
Some run continuously from boot to shutdown
Run in user mode ( do not have privileged permission)

referred to as services/subsystems/daemons

45
Q

Application programs

A

user-oriented programs that do not pertain to core functioning of OS

Users initiate and run application programs

Considered external software that performs specific task

46
Q

How to design an OS

A
  1. define goals and specifications
  2. Choose hardware
47
Q

user goals

A

operating system should be convenient to use, easy to learn, reliable, safe, and
fast

  • make it safe and no data loss
48
Q

System goals

A

operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient

49
Q

debugging

A

finding and fixing errors
OS will generate log files

50
Q

cooperating process

A

Any process that can affect or be affected by other processes

51
Q

Message Passing

A

Data is sent from one process to another:
- Process A sends a message and is stored in the kernel
- Process B receives a message, retrieving the message from the kernel
(This models is useful for processes running on different computers)

52
Q

shared memory

A

Memory shared between 2 processes

  • Process A: Writes value to shared memory
  • Process B: reads value from shared memory
    (Kernel provides shared memory when requested)
53
Q

Process Control Block (PCB)

A

Generated for each process created, contains data and metadata about process

54
Q

Switching process situations (3)

A

Interrupt: OS wants different process to use CPU
I/O Request: process is added to I/O queue
Waiting for event: program is waiting for even to occur

55
Q

Context Switch

A

act of switching processes

saves PCB to load saved state of process to resume after switching is done

56
Q

daemons

A

processes waiting for work

once it receives work, it will create a process

57
Q

fork() return values (2)

A
  1. pid of parent or -1 if there was an error
  2. child process pid which is 0
58
Q

cooperating process usages (4)

A

info sharing
efficiency
modularity
convenience

59
Q

Inter-process communication (IPC) Models

A

Message Passing
Shared memory

60
Q

average memory latency formula

A

c + (1-h) * m
c: cache access time
m: time to access main memory

61
Q

average memory latency formula for multi-level cache

A

L1 + (1-h1)(L2 + (1-h2)M)

62
Q

Nonpreemptive scheduling

A

Process decides when to evict from CPU

63
Q

preemptive scheduling

A

OS decides when to evict process from CPU

64
Q

nonpreemptive schedulers (3)

A

nonpreemptive
shortest job first
first come first serve

65
Q

preemptive schedulers (3)

A

preemptive
shortest remaining time first
round robin

66
Q

FCFS pros (2) & cons (3)

A

pros
- no starvation
- simple to implement

cons
- wait time is not optimized
- long processes can hog resources
- Convoy effect: short processes wait behind long ones

67
Q

SJF pros (2) & cons (2)

A

pros
- reduce average wait time : best nonpreemptive scheduler
- favors I/O bound processes

cons
- large burst time processes can starve
- long processes can hog resources

68
Q

NP pros (1) & cons (2)

A

pros
- higher priority processes see lower wait times

cons
- processes with low priorities can starve
- long processes can hog resources

69
Q

Schedulers that cause starvation

A

NP: SJF and NP
P: SRTF and P

(avoid starvation by providing a max wait time that applies to all processes)

70
Q

SRTF pros (2) & cons (1)

A

pros
- fastest algorithm
- favors I/O bound processes

cons
- processes with large burst time can starve

71
Q

P pros (1) & cons (1)

A

pros
- higher priority processes have low wait times

cons
- processes with low priorities can starve

72
Q

RR pros (2) & cons (2)

A

pros
- starvation is not possible
- avg response time decreases

cons
- average waiting time increases
- more context switches

73
Q

meta-scheduler

A

Multiple queues of processes require a scheduler for which queue to be picked next

74
Q

time slice

A

allocated CPU time