CS470OperatingSystems
Spring2014SudokuSolutionValidatorProject
40points
Out:February14,2014
Due:February28,2014(Friday)
ThepurposeofthisprojectisprovideexperiencewithpthreadsinUNIX.
ProblemStatement
Completethesudokusolutionvalidatorprojectdescribedonpages197199inthetextbookusing
[Link]:
Theinputwillbeafilewhosenameisgivenonthecommandline.Thefilewillcontaindigits0
[Link]
[Link]
/home/hwang/cs470/project3 oncsservernolaterthanFriday,February21.
Createathreadtocheckeachrow,athreadtocheckeachcolumn,andathreadtocheckeach3x3
[Link],andpassin
[Link]
parametersstructaretobeinterpretedbythesefunctions.
Theoutputoftheprogramshouldbedisplayedtothescreenandconsistofthegridfollowedbya
messagestatingwhetherthesolutionisvalidornot.
DesignNotes
NotethatifyouwriteyourprograminC++,thattheparameterstructcanbedefinedwithout
[Link],inC++usenewand
deletefordynamicallocation(ratherthanmallocandfree).
Appropriateerrorcheckingofthecommandlineandthefileopenshouldbecompleted.
Notethatsincethegridistobesharedbetweenthreadsthatitshouldbedeclaredintheglobal
[Link]
betweenthreads.
Assignment
(20points)[Link]
explicitdesignguidelinesforthiscourse,programsshouldexhibitamodularorobjectorienteddesign.
[Link]
languageaslongasthelanguagesupportspthreads,[Link]
instructorwillonlybeabletoprovideassistanceforprojectswritteninC/C++/[Link]
thatwillmakeyourprojectifitneedstobecompiled.
(10points)Provideahighleveldiscussionoftheprogramdescribingthefunctionalityofthemajor
componentsoftheprogramandhowtheyinteractwitheachother,andamoredetaileddiscussionforthe
02/13/2014
Page1of2
[Link]
[Link],
describewhichpartsaremissingandwhatyouthinkshouldbedonetoimplementthem.
(10points)Answerthefollowingquestions:
1.
2.
3.
4.
Whataspectofthreadmanipulationdidyoufindmostdifficulttounderstand?
Whataspectofthreadmanipulationdidyoufindleastdifficulttounderstand?
What,ifanything,wouldyouchangeinyourcurrentdesign?
What,ifanything,didyoufindinterestingorsurprisingaboutthreadmanipulationthatyoudid
notknowbeforedoingthisproject?
5. Discusstheadvantagesanddisadvantagesofusing27threadstosolvethisproblemvs.using3
threads(onetodoalltherows,onetodoallthecolumns,onetodoallthe3x3subgrids)[Link]
1threadtodoallthechecking.
6. Discussthesimilaritiesanddifferencesbetweenthreadsandprocessesthatyouobservedin
completingtheshellprojectandthisproject.
WhattoSubmit
Createatarfileorzipfilecontainingthefollowingitems:
[Link]
C/C++/Java,putinstructionsonhowtoruntheprograminacommentatthebeginningofthe
mainprogramfile.
Amakefiletomakeyourproject,ifneeded
Thediscussionofthefunctionaldesignofyourproject,preferablyinPDFformat.
Theanswerstothequestionsabove,preferablyinPDFformat.
Submityourarchiveusingthesubmissionsystem([Link]
[Link],unlessyouarealsoinCS375,inwhichcase
yourusernamewillhave"cs470"appendedtoit,andyourpasswordisyourstudentIDnumberincluding
theleading0(i.e.7digits).[Link].
02/13/2014
Page2of2
[Link]