0% found this document useful (0 votes)
20 views2 pages

Chapter: 5 Concurrent Programming

The document discusses concurrent programming and multi-threading. It explains that computer systems allow multiple tasks to run simultaneously, like using a word processor while downloading files. Even single applications do multiple things at once, such as playing audio while updating its display. The Java platform supports concurrent programming with concurrency features in the language and libraries, including high-level APIs introduced in version 5.0. Multi-tasking can be done through either process-based or thread-based multitasking.

Uploaded by

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

Chapter: 5 Concurrent Programming

The document discusses concurrent programming and multi-threading. It explains that computer systems allow multiple tasks to run simultaneously, like using a word processor while downloading files. Even single applications do multiple things at once, such as playing audio while updating its display. The Java platform supports concurrent programming with concurrency features in the language and libraries, including high-level APIs introduced in version 5.0. Multi-tasking can be done through either process-based or thread-based multitasking.

Uploaded by

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

Chapter: 5 Concurrent Programming

Computer users take it for granted that their systems can do more than one thing at a
time. They assume that they can continue to work in a word processor, while other
applications download files, manage the print queue, and stream audio. Even a single
application is often expected to do more than one thing at a time. For example, that
streaming audio application must simultaneously read the digital audio off the network,
decompress it, manage playback, and update its display. Even the word processor
should always be ready to respond to keyboard and mouse events, no matter how busy
it is reformatting text or updating the display. Software that can do such things is known
as concurrent software.

The Java platform is designed from the ground up to support concurrent programming,
with basic concurrency support in the Java programming language and the Java class
libraries. Since version 5.0, the Java platform has also included high-level concurrency
APIs. This lesson introduces the platform's basic concurrency support and summarizes
some of the high-level APIs in the java.util.concurrent packages.

5.1 MultiThread Programming

Executing several tasks simultaneously is called “MultiTasking”.


There are two types of multitasking
(1) Process Based Multitasking
(2) Thread Based Multitasking
Example : Students in classroom

(1) Process Based Multitasking

Executing several tasks simultaneously, where each task is a separate


independent process, is called process based multitasking.

Example: While typing a java program in editor we can able to listen audio songs
by MP3 Player in the system. At the same time we can download a file from the
internet. All these tasks are executing simultaneously and independent of each
other. Hence it is process based multitasking.

Process based multitasking is best suitable at OS level.

(2) Thread Based Multitasking

You might also like