Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

Class notes 21CSC203P (APP)

Beoordeling
-
Verkocht
-
Pagina's
46
Geüpload op
23-11-2025
Geschreven in
2025/2026

This document contains the complete APP syllabus in clear, easy-to-understand notes. All units are explained in a structured format so you can study faster and score better. Included in this file: Full APP course coverage Unit-wise notes Important definitions & formulas Exam-focused explanations Short revision notes for quick study Clean and well-organized format Useful for assignments, tests, and semester exams These notes are perfect for students who want a complete, ready-to-study material without searching multiple sources. Simple language, neat presentation, and fully exam-oriented content. If you want to prepare the entire APP subject quickly and effectively, these notes are exactly what you need.

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

Unit 3


Concurrent Programming:
Java Concurrency is the capability of the Java platform to run multiple
operations simultaneously. The operations could be multiple Java
programs or parts of a single Java program. Java Concurrency relies
on two essential components such as threads and processes. Of the
two components, threads play a significant role. With Java
Concurrency or using multiple threads, you can enhance the
performance of processors. You don’t need multiple processors for
running concurrent programs in Java; instead, you can use a single
multi-core processor. Know that a multi-core processor will have
many cores in a single CPU. All these multiple cores can run many
programs or parts of a program simultaneously.
You are probably familiar with multitasking, which is when someone
tries to perform two or more tasks simultaneously. While people are
not very good at multitasking, it turns out that computers are! It has
become increasingly commonplace for computer systems to have
multiple processors, or processors with multiple execution cores,
which greatly enhances a system’s capacity for concurrent execution
of processes and threads.
This process is possible even on simple systems, with only one
processor or execution core. In software terms, performing multiple
tasks at the same time is called concurrency. Concurrency may also
be defined as the ability to run several programs or several parts of a
program in parallel.
Why Concurrent Programming?
Concurrent programming is essential in modern computing for
several reasons:

, i. Performance Improvement: Concurrent programs can utilize
multiple CPU cores efficiently, which can lead to significant
performance improvements for CPU-bound tasks.
ii. Responsiveness: For applications with user interfaces,
concurrency ensures that the application remains responsive
even when performing time-consuming operations in the
background.
iii. Resource Utilization: Concurrent programs can make better use
of system resources, such as CPU time, memory, and I/O
devices.
iv. Parallelism: Some tasks naturally lend themselves to parallel
execution, like rendering graphics, processing data, or handling
multiple client requests in a server application.


Key Concepts in Concurrent Programming:
 Thread: A thread is the smallest unit of execution within a
program. It represents an independent flow of control that can
run concurrently with other threads. Most programming
languages, including Java, C++, and Python, provide thread
support.
 Process: A process is a self-contained program that runs
independently and has its own memory space. Processes can
have multiple threads, and inter-process communication (IPC) is
required for them to communicate.
 Concurrency vs. Parallelism: These terms are often used
interchangeably, but they have distinct meanings. Concurrency
is about managing multiple tasks in overlapping time periods,
while parallelism is about executing multiple tasks
simultaneously.
 Synchronization: When multiple threads or processes access
shared resources (like variables, data structures, or files),

, synchronization mechanisms are needed to ensure data
consistency and avoid conflicts, such as race conditions.
 Race Condition: A race condition occurs when two or more
threads or processes access shared data concurrently, leading
to unpredictable and erroneous behavior. Proper
synchronization can prevent race conditions.
 Mutex (Mutual Exclusion): A mutex is a synchronization
primitive that allows only one thread or process to access a
shared resource at a time. It helps prevent race conditions.
 Thread Safety: Code is considered thread-safe when it can be
safely executed by multiple threads without causing data
corruption or unexpected behavior. Design patterns and
synchronization mechanisms are used to ensure thread safety.
 Deadlock: Deadlock occurs when two or more threads or
processes are unable to proceed because each is waiting for the
other to release a resource. Careful design and resource
management are essential to avoid deadlocks.
 Thread Pool: A thread pool is a collection of pre-initialized
threads that can be reused for executing tasks, which helps
minimize the overhead of thread creation and destruction.
 Concurrency Control: In database systems, concurrency control
mechanisms ensure that multiple transactions can access and
modify the database concurrently without causing data
inconsistencies.
Thread Class in Java
A thread is a program that starts with a method() frequently used in
this class only known as the start() method. This method looks out
for the run() method which is also a method of this class and begins
executing the body of the run() method.
Syntax:
public class Thread extends Object implements Runnable

, Constructors of this class are as follows:
 Thread():Allocates a new Thread object.
 Thread(Runnable target): Allocates a new Thread object.
 Thread(Runnable target, String name) :Allocates a new Thread
object.
 Thread(String name):Allocates a new Thread object.
 Thread(ThreadGroup group, Runnable target):Allocates a new
Thread object.
 Thread(ThreadGroup group, Runnable target, String
name):Allocates a new Thread object so that it has targeted as
its run object, has the specified name as its name, and belongs
to the thread group referred to by a group.
 Thread(ThreadGroup group, Runnable target, String name, long
stackSize):Allocates a new Thread object so that it has targeted
as its run object, has the specified name as its name, and
belongs to the thread group referred to by group, and has the
specified stack size.
 Thread(ThreadGroup group, String name):Allocates a new
Thread object.


What are Thread Objects?
Know that each thread is connected with an instance of the Thread
class. Java Concurrency offers two methods through which you can
create concurrency in applications with thread objects. If you want to
control thread creation and management directly, you have to
instantiate the Thread class whenever the application requires
initiating an asynchronous task. Similarly, if you want to abstract the
thread creation and management from the rest of the application,
you must pass the applications' tasks to executors.
Let’s discuss the use of thread objects below:

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
23 november 2025
Aantal pagina's
46
Geschreven in
2025/2026
Type
College aantekeningen
Docent(en)
Harshit mehta sir
Bevat
Alle colleges

Onderwerpen

$8.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
nitin8

Maak kennis met de verkoper

Seller avatar
nitin8 SRM Institute of Science and Technology
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
6 maanden
Aantal volgers
0
Documenten
8
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen