资源描述:
《assignment 1 scheduling & synchronization1调度任务&;同步》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、Assignment1:Scheduling&SynchronizationGeneral:Inthisassignment,youareaskedtowriteasimulatedsmalloperationsystem,onethatcontainsaschedulerandsupportsthecreationandrunningofmultiplethreads.Yourschedulerwillimplementseveralschedulingpolicieswhichyouhavelearnedinclass.Inotherwords,yoursimulatedOS
2、willcontainascheduler,andthreads.Threadsthatarenottherealthreadsinlinux,butthreadsofyoursimulatedOS.DonotconfusewiththerealOS(linux,unix,windows)anditsthreads.Yourprogramcontainstwolayers.Thebottomlayer,isyourvirtual“small”operatingsystem,containingamongotherthings,ascheduler.Thebottomlayeral
3、sooffersthetoplayerfunctionsfortheuseofthreads.Thetoplayer,iscomposedofadistributedalgorithmwhichperformsadistributedcomputation,usingmultiplethreads.Theparticularalgorithmiscalledupdate.Thecommunicationmodel:The networkisrepresentedbyacommunicationgraphG=(V,E).Thesetofvertices(alsocallednode
4、s,ornode-threads)VrepresentsasetofprocessesandissimulatedbythesetofThreads.AnedgebetweenPiandPjrepresentsacommunicationchannelbetweenthetwoprocesses/threadsPiandPj.Everythreadsendsandreceivesmessagesonly to/fromitsneighbors. Update:Theupdatealgorithmisrunoneverythread.Thesethreadscommunicatew
5、ithoneanother(eachoneonlywithitsimmediateneighbors),todiscoverwhichnode-threadsareinthesystem,andwhatistheshortestdistance(hops)toeachsuchnode-thread,andwhatisthebestroutetothatnode-thread.YourprogramUpdate–analgorithmthateach“simulated”threadrunsAsimulatedsimpleOS–createsandrunsthreadsusingv
6、ariousschedulingalgorithmsTherealoperatingsystem(unix/linux..)withitsownbuiltinschedulerandmanymanyotherthingsNexttheupdatealgorithmwillbedescribed,andthenthefunctionalityandarchitectureofthebottomlayerwillbeexplainedindetail.Update:Thedistributedalgorithmthatistobeimplementedbythemultithread
7、edprogram,computesroutingtablesforeverynodeontheconnected("communication")graphG.Whenamessageissentfromnodeitonodej,itpassesthroughseveralothernodes.Eachsuchnode,k,hasaroutingtablewhichcontainsroutinginformation.Theparticularformofroutinginfo