COMP20007Design of Algorithms

1Introduction1.1OverviewThe goalof thiscoursework istomake useof operatingsystemAPIs,particularlythePOSIX API,toimplementaprocesssimulatoron Linux.Your finalimplementation willbe basedupon principlesthatyou wouldfindinmodern operatingsystems,and willexploitsomestandardconcurrencytechniques.Completingallthetaskswillgiveyou agood understandingof:Key conceptsinoperatingsystems.The useofoperatingsystemAPIs.Implementationsofprocesstablesandprocessqueues.The basicsofconcurrent/parallelprogramming usingoperatingsystemfunctionality.Criticalsections,semaphores,mutexes,and mutualexclusion.Bounded bufers.C programming.Successfullyimplementingthecourseworkwillbeakeysteptowardsthelearningoutcomesforthismodule.To maximise your chances of completing this coursework successfully,and to give you thebestchance ofgetting agood grade,itisrecommend that you break itdown in the diferentstageslistedinSection3.Eachstepgraduallyaddsmorecomplexityandbuildsupkeyinsights.Onlythefinalversionofyourcode,which willincludeallcomponentsofthepreviousstages,shouldbesubmittedinMoodle.Onlythissubmittedversionwillbemarked.1.2Coding1.2.1ServersTutorialson how tologon totheserversareavailableintheLabsectionon theMoodle page.Whenof campus:From Windows:

--Setup ansshtunnelusing:plink-N-L2201:bann.cs.nott.ac.uk:22-P2222<username>@canal.cs.nott.ac.uk--When using WinSCP or Putty,make suretospecifylocalhostforthehostname and port2201toconnectto.From iOS/Linux:--Forsshuse:ssh-J<username>@canal.cs.nott.ac.uk:2222<username>@bann--Forscpuse:scp-J<username>@canal.cs.nott.ac.uk:2222file.c<username>@bann:Thiswillcopyfile.ctoyourroothome directory.TheH:drivewhere you storeyourcode isshared withtheservers.Any codewritteninan editorsuchasNotepad++orVisualStudio,andstoredontheH:drive,willbeautomaticallyvisibleonbann,andcanbecompiledthereusingansshconnection.Important:You must testthatyou are able toconnect to the serversfrom home using ansshtunnelearlyinthetermsothatanyproblemscanberesolved.NotbeingabletoconnecttotheserverswillnotbeavalidgroundforECs.1.2.2GNU C-CompilerYour codemustcompile and run onbann.cs.nott.ac.uk.Your submission will be tested and markedon thismachine,andwe cannotaccountforpotentialdiferenceswithotherconfigurations.You can compile your code with the GNU C-compiler using the commandgcc-std=gnu99<sources>,where<sources>isalistof Csourcefiles.Forexample:gcc-std=gnu99file1.cfile2.ccompilesanexecutablecalleda.outfromtwosourcefiles.Ifyouareusingpthreads,youmustaddtheflag-lpthreadwhen compiling.Forexample:gcc-std=gnu99file.c-lpthreadcompilesanexecutablecalleda.outfromonesourcefilewhichmightusethepthreadlibrary.Ifyouwanttospecifythenameoftheexecutablefile,extendyourcompilecommandwith-o<output>where<output>isyourchoiceof outputfilename.Forexample:gcc-std=gnu99file.c-oprog-lpthreadcompilesan executablecalledprogfromonesourcefilewhichmightusethepthreadlibrary.1.2.3GNU DebuggerCodeontheserverscanbedebuggedfromthecommandlineusing---gdb---,theGNU debugger.Tutorialson how tousethedebuggerareavailableonline.Seeforinstancehttps://www.cs.cmu.edu/∼gilpin/tutorial/.

相关推荐
老猿讲编程2 小时前
安全C语言编码规范概述
c语言·开发语言·安全
fai厅的秃头姐!8 小时前
C语言03
c语言·数据结构·算法
life_time_8 小时前
C语言(22)
c语言·开发语言
鱼嘻11 小时前
Linux自学day23-进程和线程
linux·服务器·c语言·进程和线程
BUG 劝退师11 小时前
C语言预处理学习笔记
c语言·笔记·学习
小立爱学习12 小时前
Linux 内核自旋锁spinlock(四)--- queued spinlock
linux·c语言
我爱蛋蛋后15 小时前
Linux驱动开发之音频驱动与基础应用编程
linux·c语言·驱动开发·音视频
卷卷的小趴菜学编程15 小时前
c++之多态
c语言·开发语言·c++·面试·visual studio code
大白的编程日记.17 小时前
【C++笔记】C+11深度剖析(三)
c语言·开发语言·c++
和光同尘@18 小时前
56. 合并区间 (LeetCode 热题 100)
c语言·开发语言·数据结构·c++·算法·leetcode·职场和发展