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

相关推荐
Uu_05kkq17 分钟前
【C语言1】C语言常见概念(总结复习篇)——库函数、ASCII码、转义字符
c语言·数据结构·算法
嵌入式科普3 小时前
十一、从0开始卷出一个新项目之瑞萨RA6M5串口DTC接收不定长
c语言·stm32·cubeide·e2studio·ra6m5·dma接收不定长
A懿轩A3 小时前
C/C++ 数据结构与算法【栈和队列】 栈+队列详细解析【日常学习,考研必备】带图+详细代码
c语言·数据结构·c++·学习·考研·算法·栈和队列
1 9 J4 小时前
数据结构 C/C++(实验五:图)
c语言·数据结构·c++·学习·算法
仍然探索未知中5 小时前
C语言经典100例
c语言
爱吃西瓜的小菜鸡5 小时前
【C语言】矩阵乘法
c语言·学习·算法
Stark、6 小时前
【Linux】文件IO--fcntl/lseek/阻塞与非阻塞/文件偏移
linux·运维·服务器·c语言·后端
deja vu水中芭蕾7 小时前
嵌入式C面试
c语言·开发语言
stm 学习ing9 小时前
HDLBits训练3
c语言·经验分享·笔记·算法·fpga·eda·verilog hdl
CSND74013 小时前
Ubuntu vi(vim)编辑器配置一键补全main函数
linux·c语言·ubuntu·编辑器·vim