JAVA
University of Gondar
College of Informatics
Department of Computer Science
Aleka T.
MULTITHREADING CONCEPT
Aleka T.
• Multiprocessing : Process-based multitasking is
a heavyweight process and occupies different
address spaces in memory. Hence, while
switching from one process to another, it will
require some time be it very small, causing a lag
because of switching. This happens as registers
will be loaded in memory maps and the list will
be updated.
• Multithreading : Thread-based multitasking is a
lightweight process and occupies the same
address space. Hence, while switching cost of
communication will be very less.
Why do we need threads?
• To enhance parallel processing
• To increase response to the user
• To utilize the idle time of the CPU
• Prioritize your work depending on priority