Wednesday, February 18, 2009
Can things be this romantic...!!??
What is multi-processing? What is multi-tasking? What is multi-threading? What is multi-programming?
Single tasking is a system where once a programme starts, no other programme can run until it has ended. Eg early home computers, you loaded a prog. ran it then moved on to the next prog.
Multi tasking/programming/ time sharing is where several progs are running at the same time, but only 1 prog is actually being worked on at any moment in time. The system will share its time between progs that need some action, but always only 1 prog at a time. If a prog needs data from disk/ram it will wait for the data to arrive. This time is used to work on other progs that already have the data needed. The earliest versions of this merely "time sliced" or shared equally between progs whether they needed time or not.
Multi processing is where you have, for example, 2 processors that allows work to be done on 2 progs at the same time. Big servers start at 32 processors and go up from there.
Lets say that you need to add 2 numbers, the hardware sequence runs something like:-
Fetch the instruction
Decode it
fetch the 1st number from memory store in a register
fetch the 2nd number etc etc
add the 2 numbers and store the result in another register.
Multi threading allows several parts of the program to be processed without waiting for the first instruction to finish.
In the above example, each step is undertaken by a different part of the hardware, so when our instruction above has been fetched, it goes away and fetches the next instruction, so all the steps of instructions are working their way through a "pipeline". Modern processors have multi pipelines to make things even quicker. This is why some processors with a lower clock speed can out perform other CPUs. This effectively simulates multiprocessing as different progs can be in different pipelines (hyperthreading).
It is not unusual to have multiple processors, with multiple pipelines working on 1 prog. Usually something like weather forcasting where lots of similar data from many sources needs manipulating.
What is memory-mapped I/O? How is it different from I/O mapped I/O?
Memory-mapped I/O, meaning that the communication between the I/O devices and the processor is done through physical memory locations in the address space. Each I/O device will occupy some locations in the I/O address space. i.e., it will respond when those addresses are placed on the bus. The processor can write those locations to send commands and information to the I/O device and read those locations to get information and status from the I/O device.
Memory-mapped I/O makes it easy to write device drivers in a high-level language as long as the high-level language can load and store from arbitrary addresses.What are demand- and pre-paging ?
With pre-paging, pages other than the one demanded by a page fault are brought in. The selection of such pages is done based on common access patterns, especially for secondary memory devices.
What did you understand by term COMPACTION ?
Compaction refers to the mechanism of shuffling the memory portions such that all the free portions of the memory can be aligned (or merged) together in a single large block.OS to overcome the problem of fragmentation, either internal or external, performs this mechanism, frequently.
Compaction is possible only if relocation is dynamic and done at run-time, and if relocation is static and done at assembly or load-time then compaction is not possible.
What is cycle stealing?
Note that cycle stealing can be done only at specific break points in an instruction cycle.
What are turnaround time and response time?
Turnaround time is the interval between the submission of a job and its completion.
Response time is the interval between submission of a request, and the first response to that request.