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

相关推荐
爱吃生蚝的于勒37 分钟前
C语言内存函数
c语言·开发语言·数据结构·c++·学习·算法
失落的香蕉4 小时前
C语言串讲-2之指针和结构体
java·c语言·开发语言
ChoSeitaku6 小时前
链表循环及差集相关算法题|判断循环双链表是否对称|两循环单链表合并成循环链表|使双向循环链表有序|单循环链表改双向循环链表|两链表的差集(C)
c语言·算法·链表
DdddJMs__1356 小时前
C语言 | Leetcode C语言题解之第557题反转字符串中的单词III
c语言·leetcode·题解
娃娃丢没有坏心思7 小时前
C++20 概念与约束(2)—— 初识概念与约束
c语言·c++·现代c++
ahadee8 小时前
蓝桥杯每日真题 - 第11天
c语言·vscode·算法·蓝桥杯
No0d1es9 小时前
2024年9月青少年软件编程(C语言/C++)等级考试试卷(九级)
c语言·数据结构·c++·算法·青少年编程·电子学会
Che3rry10 小时前
C/C++|关于“子线程在堆中创建了资源但在资源未释放的情况下异常退出或挂掉”如何避免?
c语言·c++
kuiini11 小时前
C 语言学习-02【编程习惯】
c语言·学习
木辛木辛子11 小时前
L2-2 十二进制字符串转换成十进制整数
c语言·开发语言·数据结构·c++·算法