Lecture 4: Processes Flashcards

1
Q

define process

A

program in execution

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

5 parts in process

A
  • text section (program code)
  • program counter (current activity)
  • heap (memory dynamically allocated during run time)
  • data section containing global variables
  • stack containing temporary data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

5 states in process

A
  1. new: program being created
  2. running: instruction being executed
  3. waiting: process waiting for event to occur
  4. ready: process waiting to assign to processor
  5. terminate: process finish execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is process control block (PCB)

A

information associated with each process
- process state
- program counter
- CPU register
- CPU scheduling information
- memory management
- accounting information
- I/O status information

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

define process schedulling

A

quickly switch process onto CPU for time-sharing to maximize CPU use

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

3 scheduling queue

A
  • job queue: set of all processes in system
  • ready queue: set of processes in main memory, ready and waiting for execute
  • device queue: set of processes waiting for I/O device
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

representation of process scheduling

A
  1. new process is put in ready queue, waiting for execution
  2. the process will be allocated the CPU and executed
  3. one of the events will occur
    - process issue I/O request and enter I/O queue to waiting
    - process create new child process and waiting for child to terminate
    - process is removed from CPU. causing an interrupt, put back to ready queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

2 types of scheduler

A

long-term scheduler (job scheduler)
- select process to be bring into ready queue
- may be slow
- determine degree of multiprogramming

short-term scheduler (CPU scheduler)
- select process to be execute next and allocate CPU
- must be fast

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

I/O-bound process and CPU-bound process

A

I/O-bound process
- spend more time on I/O than computation
- many short CPU burst

CPU-bound process
- spend more time on computation
- few long CPU burst

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

define context switching

A

when CPU switches to another process, the system must saved the state of old process, and load the saved state for new process

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

define process creation

A

Parent process create children process, than continue to create other children process, forming a tree of processes
- process is identified and managed via process identifier (pid)
- 3 possible result of resource sharing
- 2 possible result of execution
- 2 possible result of address space

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

reasons for cooperating process

A
  • sharing information
  • convenient
  • speedup computation
  • modularity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

two models of Interprocess Communication (IPC)

A
  • shared memory
  • message passing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

two types of process

A
  • independent (cannot affect or to be affected by other process execution)
  • cooperating (can ‘’ )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

define message passing

A

mechanism for process to communicate and synchronize the actions
- message system allow process to communicate with each other without resorting shared variable

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

2 steps in message passing

A
  • create communication link
  • exchange messages via send/receive
15
Q

4 advantages of threads

A
  • scalability
  • lower cost: shared resources make economical to create and context switch thread
  • resource sharing: allow different thread of activity within the same address space
  • responsiveness: program continue to run even part of it is blocked
16
Q

challenges in multicore programming

A
  • identify task
  • balance
  • data splitting
  • data dependency
  • testing and debugging
17
Q

three primary user thread libraries

A
  • POSIX thread
  • Win32 thread
  • Java thread
18
Q

define swapping

A
  • process can be reintroduced into memory and continue its execution where it left off