You are on page 1of 1

multithreading programming

threads:
Executing some part of the process.
Threads are light weight process.
Shared the same address space of process.

===================================================================================
================
life cycle if threads
1. Newborn state
2. running state
3. runnable state
4. blocked state
5. dead state

===================================================================================
===============

cteating threads:
1. by extending "thread" class
2. immplementing "runnable" interface

===================================================================================
=================

by extending "thread" class


step-1: declare the class as extending "thread"class
step-2: immplement the "run()" method that is responsible for excuting the thread
code.
step-3: create the thread object and call the "start()" method to initatate the
excution of thread.

===================================================================================
=================

immplementing "runnable" interface

step-1: declare the class as immplementing "runnable" interface.


step-2: implement yhe "run" method.
step-3: create a thread by defing an object that is instantiated from the runnable
class.
step-4: call the threads start method to instantiat excetuction thread

===================================================================================
=================

Batch os
interactive os
multiprogramming os
multiprocessing os
multitasking os /time sharing os
multi user os
multithreading os
real time os
distributed os

You might also like