Synopsis
Process Scheduling in Android
Submitted By ….. Ishan (11110699) RK1107B40
What is Android ? Like the WebOS, Android is an operating system based upon the pre-existing linux operating system, optimized for mobile devices. It is designed primarily for touchscreen mobile devices such as Smartphones.Initially developed by Android Inc, it was later bought by Google in 2005. And since then it is being backed and developed by the technology giant. It is an open-source project, which means that all the source code is available free of cost. Android is licensed under the Apache License. Since it is under the Apache license, it requires the preservation of copyright notice and the disclaimer. The Apache License allows the user of the software the freedom to use the code, modify it, and distribute it, even for the purpose of generating royalties without being concerned of sharing the royalty with the original project creators. Since it is an operating system designed for mobile devices, a lot of decisions have to be made which has to favor the conditions of a mobile device.
For Example : It doesn’t have the power supply like the desktops or Laptops; that mean it has to keep the power usage in extreme check. Tiny screens mean that for the user experience to be great, the interface has to be revamped completely. Since the user is gonna hold the devices a lot closer than the traditional desktops, it means greater pixel density and thus more processing for displaying same amount of content when compared to desktops. Android has a list of features that it supports, some of the features that it supports right now areIn addition to supporting multimedia files, GSM, Bluetooth, Wifi, GPRS and having an internet browser. It also have an Application Framework for the developers to work on, Dalvik Virtual Machine (Java Byte Code interpreter, optimized for mobile) Webkit engine, SQLite, OpenGL ES.
What is Process-Scheduling ? Scheduling in its strictest sense refers to the management of Processes, Threads and flow of the data. Scheduling algorithms are used for allocating resources among different entities which are requesting them simultaneously and asynchronously. There are different techniques and Algorithms which have been developed over time for the management (Scheduling) over time.
The three distinct categories of Schedulers : Long Term Scheduler Mid Term Scheduler Short Term Scheduler Some Algorithms which garnered more attraction than others in the race of popularity and performance are :
First in First out Also known as First Come First Serve. It is the simplest scheduling algorithm. First In First Out (FIFO) simply processes the requests as they arrive. None of the other algorithms are this simple. FIFO doesn’t comes in the group of the effective scheduling algorithms for general purpose cases, where the user almost always is multi-tasking.
Shortest Job First Also known as SJF, this technique we compare which is the shortest job available at the time to be done. We then execute that specific job stalling any other longer job which may have been requested long ago. This algorithm may effectively block any large process if there are many smaller process requests spurring continuously.
Shortest Remaining Time Similar to Shortest Job First, this strategy requires the scheduler to arrange requests in the order where the least estimated processing time remaining is to be executed first. This algorithm requires advanced knowledge or estimations about the time required for a job to complete.
Fixed Priority Preemptive Scheduling The algorithms assigns a fixed priority rank to every job. It then arranges the processes in order of their priority. Lower priority gets executed last however higher priority gets executed earlier. Execution of lower priority jobs can be interrupted by higher priority jobs.
Round Robin Scheduling In this case the scheduler assigns a fixed amount of time (quantum time) of execution to be given to every job. If the job gets executed within the time frame, the scheduler moves to the next job, but if the job is not done, it has to wait for the scheduler to cycle through all the processes before coming back to it.
Multilevel Queue Scheduling This is used for situations in which jobs are easily divided into groups.
Process Scheduling in Android : As it is already mentioned that android is based on Linux. Thus it means that it’s kernel is derived after making changes to the Linux’s kernel to be optimized for mobile devices. Android is currently using Linux 2.6 for it’s low level management of resources. Linux 2.6 happens to use Completely Fair Scheduler. It is made by Ingo Molnár, who was inspired by the Con Kolivas’s work on “Fair Scheduling”. Applications in Android are know as Activities. Each activity has it’s own lifecycle. Based on the work that each activity is doing, they are categorised into different categories and priority is set on the basis of importance of the activity to the user. Whenever an application component starts and the application does not have any other components running a new linux process is started for it with a single thread of execution (also known as main thread or the UI thread). The different categories of the processes are : 1. Foreground Process 2. Visible Process 3. Service Process 4. Background Process 5. Empty Process Android ranks a process at the highest level it can find suitable for it, based upon the importance of the components currently active in the process.
References : Android Developers http://developer.android.com Cornell University Library http://arxiv.org/ Stackexchange http://android.stackexchange.com Stackoverflow http://stackoverflow.com Wikipedia | English http://en.wikipedia.org Google https://www.google.co.in/ Unixmen http://www.unixmen.com Google Docs https://docs.google.com Scribd http://www.scribd.com Tutorials Point http://www.tutorialspoint.com Gitam University http://www.gitam.edu Worcester Polytechnic Institute http://www.wpi.edu