Wecouldgivetheillusionthattheseprocessesareallrunningatthesametime, andoccasionallytheybecome a blockedonthatcanthenbereadytobewinnableuntiloneofthemfinishes.
I knowsomebodyputhercommentonthepreviousvideosaying, Woulditbepossibletogodirectlyfromcreatetorun a ble?
Andsowesaidwhenwelookedatthisvideothatthesethreethingsweneedweneedthismodelsoweknowhowwe'regoingtoswitchthemonwhichoneswecanswitchuntilweneed a wayofknowingwhichprocesswe'regonnamovefromrentabletorunning.
Sotounderstandhowcontextwhichitworksweneedtothinkabouthow I CPUexcuseproblem.
Sothat's actuallyhave a lookat a verysimpleprogram.
I'm gonnawriteitusingourmachinecode, becausethecontextwhichitdoeshappenatthemachinecodeleveldoesn't happen a higherupasweuse a compartmenthighlevellanguage.
Sothinkabout a verysimpleprogramthatisgoingtoloadin a string.
I'm gonnauseourmachine K forthisexample.
Sowe'regonnaloadintheaddress.
I wasstrayingintoourzero.
Solet's callthis a stringandthenwe'regoingThio, printitoutondhe.
I usethedevelopmentenvironmentfordevelopingourmachinecodeshouldyouintotheUniversityofManchester, whichallowsmetocalltheequivalentoftheoperatingsystemusingswinethreetoprintsomethingoutthat's gottaprintsomethingout, willdefineeight.
Stringuphere, tow, have a helloworldinit, andthenlet's dosomething.
Let's printoutallthenumbersfrom 1 to 10 sowe'llmoveintoourwarnthevalleyofzero, andthenwe'llstart a loopwecanadd.
Ourwar, whichisaddsoneontoit, whichisoneyetandthenstorestheresultbackin I wantwithoutthenextlinewhichgetsthevalueareonewhichisoneandstoresitinourmovesitintoourstherewithandcallswatforwhichprintsitout.
Whatwedoiswehave a processcontrolBachforeachprocessinoperatingsystem.
Onitspartofthat, westorethevaluetotheregistersand a fewotherthingsinthatifwestartoffbyhaving a lookatourpricescontrolbox, wehave a registerpointingtothat, andwecanuseour 13 forthis.
Whenhe's askedtheoperatingsystemtodosomething, wecouldthenmake a switch, andthat's whethertogostraightfortheoperationgetstotheendofwhateveritwasitwasdoingfortheprocess, anditcouldthenmake a contextwhichshowitmovestothedifferentprocess.