0% found this document useful (0 votes)
13 views13 pages

Multi

Multithreading is a method that allows multiple threads to run simultaneously, improving CPU utilization and conserving memory. A thread is a path of execution in a program, with the main thread initiated by the Java Virtual Machine. Processes are self-contained execution environments with their own memory space, and thread priorities help determine the order of execution among threads.

Uploaded by

Rohan Pareek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views13 pages

Multi

Multithreading is a method that allows multiple threads to run simultaneously, improving CPU utilization and conserving memory. A thread is a path of execution in a program, with the main thread initiated by the Java Virtual Machine. Processes are self-contained execution environments with their own memory space, and thread priorities help determine the order of execution among threads.

Uploaded by

Rohan Pareek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Mtltithreading

What is multithreading
?
• Multithreading is the method of running two or more
threads at the same time to maximize CPU utilization.
it is often referred to as Concurrency in Java. Each
thread runs in parallel with the others. Since several
threads do not assign different memory areas, they
conserve memory. Furthermore, switching between
threads takes less time. Multithreading enhances
program structure by making it simpler and easier to
navigate. These generalized threads can be used in
high-server media applications to easily change or
enhance the configuration of these complex structures.
What is Thread ?
• A thread is the direction or path that is taken while a
program is being executed. Generally, all the programs have
at least one thread, known as the main thread, that is
provided by the JVM or Java Virtual Machine at the starting of
the program’s execution. At this point, when the main
thread is provided, the main() method is invoked by the
main thread.
• A thread is an execution thread in a program. Multiple
threads of execution can be run concurrently by an
application running on the Java Virtual Machine. The priority
of each thread varies. Higher priority threads are executed
before lower priority threads.
What is process ?
• A process is a self-contained execution environment. A process
generally has a complete, private set of basic run-time
resources; in particular, each process has its own memory space.

• Processes are often seen as synonymous with programs or


applications. However, what the user sees as a single application
may in fact be a set of cooperating processes. To facilitate
communication between processes, most operating systems
support Inter Process Communication (IPC) resources, such as
pipes and sockets. IPC is used not just for communication
between processes on the same system, but processes on
different systems.
Lifecycle of
Threads
What is Thread Priorities ?
• Thread a priority that determines how that thread
should be treated with respect to the others. Thread
priorities are integers that specify the relative priority of
one thread to another. As an absolute value, a priority is
meaningless; a higher-priority thread doesn’t run any
faster than a lower-priority thread if it is the only thread
running. Instead, a thread’s priority is used to decide
when to switch from one running thread to the next.
This is called a context switch. The rules that determine
when a context switch takes place are simple.
What is without priorities ?
Thank You

You might also like