Due date: Monday, October 6th
You must turn in your homework in written (or typed) form by the beginning of class on the date it is due.
The questions are based on material presented in class and reading material from the text.
Give brief answers to the following questions:
Give two advantages to the use of multiple threads instead of the use of multiple processes.
Consider an OS with the below process control block (PCB). Write another data structure that contains exactly enough information needed to support threads.
struct PCB { int pid /* Process ID */ int state; /* ready, running or blocked */ int timeLeft; /* time left since last time slide */ struct SaveArea sa; /* hardware state to save */ struct InOut *pIO; /* pointer to IO descriptors */ struct Heap *pHeap; /* pointer to heap */ struct Stack *pStack; /* pointer to stack */ };
Briefly explain the difference between internal and external fragmentation. In particular, explain why paging has no external fragmentation. What kind of fragmentation do you have with variable sized partitions?
Given free, variable-sized memory partitions of 100K, 500K, 200K, 300K and 600K (stored in that order) and memory requests given chronologically in 250K, 419K, 205K and 330K. Assuming you allocate free memory using a first-fit (the first free partition big enough for the request is allocated) strategy, describe what requests go in what partiions. Now, assuming you allocate free memory using a best-fit strategy (that minimizes the size of the 'left-over' partition), describe what requests go in what partiions. Which algorithm makes the most efficient use of the memory?
What is a relocation register? Describe briefly how an OS might be limited in its ability to manage memory use without a relocation register (or other memory management hardware).
Consider a logical address space of 16 pages of 4096 bytes (words) each, mapped onto a physical memory of 64 frames.
Consider a paging system with the page table stored in memory.
What kind of fragmentation do we have with paging? Given N processes in memory, how much fragmentation do we have?
Return to the CS3013 Home Page
Send all questions to the TA mailing list.