eksamensprepp Flashcards
(24 cards)
what is inside code - memory
OS instantiates code, and other static data
what are in the stack
used for function calls, local variables
Fast, structured (LIFO)
what are in the heap
dynamic memory (e.g., malloc, new)
page and page frame size
page - fixed size block in virtual memory
page frame - fixed size block physical memory
same size (4KB)
what does condition variable do
producer to wait until there is space
consumer to wait until there is an item in the buffer
producer consumer problem - what is the goal
We need to ensure that when a producer is placing an item in the buffer, then at the same time consumer should not consume any item
what is the critical section i producer-consumer problem
the buffer
solve producer consumer
needs 2 semaphores - 1 full 1 empty
semaphore value = 0 -> then calls wait -> what happens
nothing, cant call wait, bc the thread sleeps
difference between SSD and HDD
SSD shorter life span - bc limited write cycles
must all queues in MLFQ use the scheduling algorithm
no
method to fix external fragmentation
compact - small blocks into one big
internal vs external fragmentation
Internal fragmentation = unused space inside an allocated block(pages)
External fragmentation = unused space between allocated blocks (heap, stack)
what is not shared among threads
stack registers of threads
each thread has its own stack
fork - hva returnerer den
returnere to forskjellige prossesser
parent - 0 >
child - returner 0
solution for critical section
mutual exlusion, bounded waiting, progress
what does progress mean in ensuring critical section is safe
thread want to enter the critical section, and no one is inside
→ then some process must be allowed to proceed
what is bounded waiting
here must be a limit (bound) on how many times other processes can enter their critical sections before a waiting process gets its turn
hvor mange bytes er 1GB
2^30
waiting time
waiting = turnaroud - execution time