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/.

相关推荐
双叶8366 小时前
(C语言)虚数运算(结构体教程)(指针解法)(C语言教程)
c语言·开发语言·数据结构·c++·算法·microsoft
序属秋秋秋8 小时前
算法基础_基础算法【高精度 + 前缀和 + 差分 + 双指针】
c语言·c++·学习·算法
想睡hhh9 小时前
c语言数据结构——八大排序算法实现
c语言·数据结构·排序算法
KeithTsui9 小时前
GCC RISCV 后端 -- 控制流(Control Flow)的一些理解
linux·c语言·开发语言·c++·算法
JCBP_11 小时前
数据结构3
服务器·c语言·数据结构·vscode
南玖yy14 小时前
数据结构C语言练习(栈)
c语言·数据结构·算法
m0_5557629014 小时前
struct 中在c++ 和c中用法区别
java·c语言·c++
南玖yy15 小时前
数据结构C语言练习(两个队列实现栈)
c语言·数据结构·算法
北极象16 小时前
用C实现一个最简单的正则表达式引擎
c语言·正则表达式·php
JCBP_17 小时前
数据结构4
运维·c语言·数据结构·vscode