Multitasking Handling by Operating Systems
Multitasking Handling by Operating Systems
Handling Multitasking
__________________________________________________________________________________
Objective:
In this assignment we have mainly discussed the requirement and handling of multiple
processes (multitasking) in operating systems (Android & Windows).
---------------------------------------------------------------------------
Need of Multitasking
_______________________________________________________________________
Multitasking, in an operating system, is allowing a user to perform more than one
computer task (such as the operation of an application program) at a time.
The operating system is able to keep track of where you are in these tasks and go from
one to the other without losing information.
Usually, modern multitasking OSs also provide memory isolation between processes and
support different security levels, allowing OS code to do things user code cannot. A
Multitasking Operating System would be an OS that allows for the simultaneous
execution of multiple (more than 1) processes.
Time Shareable
In which, all tasks are allocated a specific piece of time, so they do not need waiting time
for the CPU.
________________________________________________________________________________________________________
2
This operating system is more comfortable for handling the multiple users concurrently,
and several programs can run smoothly without degradation of the system's
performance.
Secured Memory
Multitasking operating system has well defined memory management, because this
operating system does not provide any types of permissions of unwanted programs to
wasting the memory.
Multitasking operating system contains the best virtual memory system. Due to virtual
memory, any program does not need long waiting time for completion of their tasks, if
this problem occurs then those programs are transferred to virtual memory.
Background Processing
Good Reliability
Multitasking operating systems provide several flexibilities for multiple users, and they
are more satisfied with them. On which, every user can operate single or multiple
programs smoothly.
Thus we can see, multitasking is such a beneficial trait of modern operating systems.
________________________________________________________________________
3
Multitasking on Android
_______________________________________________________________________
By now we know that Android is based on Linux. As such, each application runs in its
own process (with a unique PID): this allows the app to live in an isolated environment,
where it cannot be hindered by other applications/processes. Typically, when you want
to start an application, Android creates a process, spawns the main thread and starts
running the main Activity.
In the introduction, we mentioned that each Android app has a memory budget for its
execution that cannot be exceeded. To be precise, that limit is enforced on a
per-process basis. In other words, each process of an application will have a dedicated
memory budget! (not to mention different rules for its termination, which is even more
cool)
________________________________________________________________________
Let’s see whether this approach is going to be a good thing or a bad thing:
________________________________________________________________________
4
As we just mentioned, a separate process can take advantage of its own RAM budget,
allowing the main process to have more space for its resources.
In addition, processes that run different components are treated differently by the OS.
This means that, in conditions where the system is running low on available memory,
not all of them are to be killed. Consider this: your music player is running in the
background and the music is playing; suddenly, the system needs to free some memory .
Since the service that plays the music runs on another process, it is extremely likely that
the OS is going to kill the main process first (the one that runs mainly your app UI),
leaving the music playing in the other process.
On a final note, this looks good for the end user as well! Because each of your app’s
processes will have its own entry in the RAM usage screen of the Application Manager,
and chances are that one or more of them are going to appear in the “Cached” section
(which means they are inactive).
5
First of all, processes are meant to be isolated by design (as a security feature), which
means that every process will have its own instance of Dalvik VM. In turn, this means
that you won’t be able to share data across those instances, at least not in the
traditional sense. For example, static fields will have their own value for each process,
and not a single one as you are inclined to believe. And this extends to every state of the
application.
________________________________________________________________________
6
Multitasking on Windows
________________________________________________________________________
Multitasking is when multiple jobs are executed by the CPU simultaneously by switching
between them. Switches occur so frequently that the users may interact with each
program while it is them. Switches occur so frequently that the users may interact with
each program while it is running. An OS does the following activities related to
multitasking −
● The user gives instructions to the operating system or to a program directly, and
receives The user gives instructions to the operating system or to a program
directly, and receives an immediate response.
● The OS handles multitasking in the way that it can handle multiple
operations/executes The OS handles multitasking in the way that it can handle
multiple operations/executes multiple programs at a time.
● Multitasking Operating Systems are also known as Time-sharing systems.
● These Operating Systems were developed to provide interactive use of a
computer system at a reasonable cost.
● A time-shared operating system uses the concept of CPU scheduling and A
time-shared operating system uses the concept of CPU scheduling and
multiprogramming to provide each user with a small portion of a time-shared
CPU.
● Each user has at least one separate program in memory.
7
8
● As the system switches CPU rapidly from one user/program to the next, each user
is given the impression that he/she has his/her own CPU, whereas actually one
CPU is being the impression that he/she has his/her own CPU, whereas actually
one CPU is being shared among many users.
____________________________________________________
9
MADE BY:
_____________________________________________________________________
LCI2020015: MANN
_____________________________________________________________________