Hi bharat,
Multithreading:
A normal microprocessor can execute instuctions only in sequence. that is it can execute instructions in a program one by one and can switch to another program only if all the instructions in the current program are executed.A thread is nothing but a assembly language program. In a multithreaded processor, more than one program can be placed in the memory, and the processor can run the instructions of all the programs simultanoeusly by switching between threads for every instruction.In this way a process need not wait for the current process to finish thus increasing the performance of the processor. Another advantage here is that in normal processors, the processor does not do any work in the time taken for the next thread get started.But in multithreading this time is considerably reduced.
Multithreading with pipeline:
In an ordinary processor with pipeline if a branch is executed and if the branching need to take place, the instruction with the address in the branch need to be executed next. So the entire pipeline is flushed.After flushing the pipeline the no. of clock cycles spent for the next execution is equal to the no. of pipeline stages before the execution stage.So the processor does not produce any output for that many clk cycles.The no. of clock cycles wasted increases as the pipeline's depth. But in multithreaded architecture since the next instruction in the pipeline is that of another thread's only very few stages of the pipeline needs to be flushed, thus increasing the throughput of the processor.
In a mutithreaded pipeline
No. of clk. cycles waste=No. of pipe stages/no. of active threads
Another very important usage of multithreading is in interrupt handling..