Synopsis
Process Scheduling in Android
SubmittedBy.. Ishan(11110699) RK1107B40
What is Android ?
LiketheWebOS,Androidisanoperatingsystembaseduponthepreexistinglinuxoperating system,optimizedformobiledevices.Itisdesignedprimarilyfortouchscreenmobiledevices suchasSmartphones.InitiallydevelopedbyAndroidInc,itwaslaterboughtbyGooglein2005. Andsincethenitisbeingbackedanddevelopedbythetechnologygiant. Itisanopensourceproject,whichmeansthatallthesource codeisavailablefreeofcost.Androidislicensedunderthe ApacheLicense.SinceitisundertheApachelicense,it requiresthepreservationofcopyrightnoticeandthe disclaimer.TheApacheLicenseallowstheuserofthesoftwarethefreedomtousethecode, modifyit,anddistributeit,evenforthepurposeofgeneratingroyaltieswithoutbeingconcerned ofsharingtheroyaltywiththeoriginalprojectcreators. Sinceitisanoperatingsystemdesignedformobiledevices,alotofdecisionshavetobemade whichhastofavortheconditionsofamobiledevice.
For Example :
ItdoesnthavethepowersupplylikethedesktopsorLaptopsthatmeanithastokeepthepower usageinextremecheck. Tinyscreensmeanthatfortheuserexperiencetobegreat,theinterfacehastoberevamped completely. Sincetheuserisgonnaholdthedevicesalotcloserthanthetraditionaldesktops,itmeans greaterpixeldensityandthusmoreprocessingfordisplayingsameamountofcontentwhen comparedtodesktops. Androidhasalistoffeaturesthatitsupports,someofthefeaturesthatitsupportsrightnoware Inadditiontosupportingmultimediafiles,GSM,Bluetooth,Wifi,GPRSandhavinganinternet browser.ItalsohaveanApplicationFrameworkforthedeveloperstoworkon,DalvikVirtual Machine(JavaByteCodeinterpreter,optimizedformobile)Webkitengine,SQLite,OpenGLES.
What is Process-Scheduling ?
Schedulinginitsstrictestsenserefers tothemanagementofProcesses, Threadsandflowofthedata. Schedulingalgorithmsareusedfor allocatingresourcesamongdifferent entitieswhicharerequestingthem simultaneouslyandasynchronously. Therearedifferenttechniquesand Algorithmswhichhavebeendeveloped overtimeforthemanagement (Scheduling)overtime.
The three distinct categories of Schedulers : LongTermScheduler MidTermScheduler ShortTermScheduler SomeAlgorithmswhichgarneredmoreattractionthanothersintheraceofpopularityand performanceare:
First in First out AlsoknownasFirstComeFirstServe.Itisthesimplestschedulingalgorithm.FirstInFirstOut (FIFO)simplyprocessestherequestsastheyarrive.Noneoftheotheralgorithmsarethis simple.FIFOdoesntcomesinthegroupoftheeffectiveschedulingalgorithmsforgeneral purposecases,wheretheuseralmostalwaysismultitasking.
Shortest Job First AlsoknownasSJF,thistechniquewecomparewhichistheshortestjobavailableatthetimeto bedone.Wethenexecutethatspecificjobstallinganyotherlongerjobwhichmayhavebeen requestedlongago.Thisalgorithmmayeffectivelyblockanylargeprocessiftherearemany smallerprocessrequestsspurringcontinuously.
Shortest Remaining Time SimilartoShortestJobFirst,thisstrategyrequirestheschedulertoarrangerequestsintheorder wheretheleastestimatedprocessingtimeremainingistobeexecutedfirst.Thisalgorithm requiresadvancedknowledgeorestimationsaboutthetimerequiredforajobtocomplete.
Fixed Priority Preemptive Scheduling Thealgorithmsassignsafixedpriorityranktoeveryjob.Itthenarrangestheprocessesinorder oftheirpriority.Lowerprioritygetsexecutedlasthoweverhigherprioritygetsexecutedearlier. Executionoflowerpriorityjobscanbeinterruptedbyhigherpriorityjobs.
Round Robin Scheduling Inthiscasetheschedulerassignsafixedamountoftime(quantumtime)ofexecutiontobe giventoeveryjob.Ifthejobgetsexecutedwithinthetimeframe,theschedulermovestothenext job,butifthejobisnotdone,ithastowaitfortheschedulertocyclethroughalltheprocesses beforecomingbacktoit.
Multilevel Queue Scheduling Thisisusedforsituationsinwhichjobsareeasilydividedintogroups.
Process Scheduling in Android :
AsitisalreadymentionedthatandroidisbasedonLinux.Thusitmeansthatitskernelisderived aftermakingchangestotheLinuxskerneltobeoptimizedformobiledevices. AndroidiscurrentlyusingLinux2.6foritslowlevelmanagementofresources.Linux2.6 happenstouseCompletelyFairScheduler.ItismadebyIngoMolnr,whowasinspiredbytheCon
KolivassworkonFairScheduling. ApplicationsinAndroidareknowasActivities.Eachactivityhasitsownlifecycle.Basedontheworkthat eachactivityisdoing,theyarecategorisedintodifferentcategoriesandpriorityissetonthebasisof importanceoftheactivitytotheuser. Wheneveranapplicationcomponentstartsandtheapplicationdoesnothaveanyothercomponentsrunning anewlinuxprocessisstartedforitwithasinglethreadofexecution(alsoknownasmainthreadortheUI thread). Thedifferentcategoriesoftheprocessesare: 1. ForegroundProcess 2. VisibleProcess 3. ServiceProcess 4. BackgroundProcess 5. EmptyProcess Androidranksaprocessatthehighestlevelitcanfindsuitableforit,basedupontheimportanceofthe componentscurrentlyactiveintheprocess.
References :
AndroidDevelopers http://developer.android.com CornellUniversityLibrary 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 GoogleDocs https://docs.google.com Scribd http://www.scribd.com TutorialsPoint http://www.tutorialspoint.com GitamUniversity http://www.gitam.edu WorcesterPolytechnicInstitute http://www.wpi.edu