Hit The Order Button To Order A **Custom Paper**

>> CLICK HERE TO ORDER 100% ORIGINAL PAPERS FROM AustralianExpertWriters.com <<

26 Aug

csc2404 Assignment 2 | Good Grade Guarantee!

csc2404 Assignment 2Semester 2, 2019Due Date: 11:59pm 18 September 2019, AESTInstructionsThis assignment consists of 4 questions, each of equal value. Pleaseanswer the questions in your own words. At most, you should onlyrequire about a page to answer each question.Clear LayoutIt is vitally important that your assignment is clearly laid out withquestions and parts of questions clearly defned. It must be astraight forward matter for the examiner to determine that youhave completed each exercise satisfactorily. We want quality notquantity. Poorly organised submissions will be rejected or receivea poor mark.A PDF/A document typeset using vanilla LATEX is preferred over adocument produced by a word-processor. If you must use MicrosoftWord or LibreOfce please export your document as PDF/A1 notPDF.Late Submission of Assignments2Students can apply for an extension of time to submit an assignment at any time up to the deadline. Students are advised to makea request for an extension as soon as their need becomes apparent.Delay in making a request involves the risk of losing marks if therequest is refused.The Examiner may grant a short extension of the deadline forsubmission of an assignment. Extensions are usually granted onlyin cases of Compassionate and Compelling Circumstances in accordance with the assessment of Compassionate and Compelling1 PDF/A is an archival format of PDF that embeds all fonts used in the document within the PDF fle. To ensure PDF/A format in Word check “ISO-19005-compliant (PDF/A)” under “Options” when saving a fle as PDF.2 The full assessment rules and regulations can be found at http://policy.usq.edu.au/documents.php?id=14749PLCircumstances Procedure. Generally, extensions will be limited toa maximum of fve University Business Days. A Student requiringan extension for a period of time in excess of this should considerapplying for a Deferred Assessment as per Section 4.4 of the assessment procedure.Applications for extensions must be made via email or USQAssist to the Examiner together with accompanying documentationas specifed in the Assessment of Compassionate and CompellingCircumstances Procedure.An Assignment submitted after the deadline without an approvedextension of time will be penalised. The penalty for late submission without a pre-approved extension is a reduction by 5% of themaximum mark applicable for the assignment, for each Universitybusiness day or part business day that the assignment is late. Anassignment submitted more than ten University business days afterthe deadline will have a mark of zero recorded for that assignment.The Examiner may refuse to accept assignments for assessmentpurposes after marked assignments and/or feedback have been released.Non-submission of Assignments and Passing Grades3To be assured of receiving a passing grade a student must obtainat least 50% of the total weighted marks available for the course(i.e. the Primary Hurdle), and have satisfed the Secondary Hurdle(Supervised), i.e. the end of semester examination by achieving atleast 40% of the marks available for that assessment item.Supplementary assessment may be offered where a student hasundertaken all of the required summative assessment items andhas passed the Primary Hurdle but failed to satisfy the SecondaryHurdle (Supervised), or has satisfed the Secondary Hurdle (Supervised) but failed to achieve a passing Final Grade by 5% or less ofthe total weighted Marks.To be awarded a passing grade for a supplementary assessmentitem (if applicable), a student must achieve at least 50% of theavailable marks for the supplementary assessment item as per theAssessment Procedure (point 4.4.2).The offer of Supplementary Assessment normally will only be madeif the Student has undertaken all possible Summative AssessmentItems for the Course (i.e. the assignments).Student ResponsibilitiesThe Assessment Procedure Section 4.2.2, also outlines the followingstudent responsibilities:3 See the University Assessment Procedure policy document2• If requested, Students must be capable of providing a copyof Assignments submitted. Copies should be dispatched tothe University within 24 hours of receipt of a request beingmade.• Students are responsible for submitting the correct Assignment.• Assignment submissions must contain evidence of student effort to address the requirements of the Assignment. In theabsence of evidence of Student effort to address the requirements of the assignment, no Mark will be recorded for thatAssessment Item.• A Student may re-submit an Assignment at any time up tothe deadline. A request to re-submit after the deadline isdealt with in accordance with section 4.4 ‘Deferred, Supplementary and Varied Assessment and Special Consideration’of these procedures.Academic MisconductAcademic misconduct is unacceptable and includes plagiarism, collusion and cheating:plagiarism : involves the use of another person’s work without full andclear referencing and acknowledgement;cheating : involves presenting another student’s work as your own;collusion : is a specifc type of cheating, that occurs when two or morestudents fail to abide by directions from the examiner regarding the permitted level of collaboration on an assessment.All are seen by the University as acts of misconduct for which youcan be penalised. For further details go to the Library’s site onPlagiarism.3Question 1 (marks 25)Answer the following questions:6 marks a. Given fve memory partitions (in order) of 100 KiB, 500 KiB,200 KiB, 300 KiB, and 600 KiB, how would each of the frstft, best-ft, and worst-ft algorithms place processes (in order) of 212 KiB, 417 KiB, 112 KiB, and 426 KiB? Whichalgorithm makes the most efcient use of memory?b. Assume a 32 bit system, with a 2-level page table, with apage size of 4KiB (p1=10bits, p2=10bits, offset=12bits).6 marks (i) A program on this system requires 16MiB in total: theprogram text segment uses 4MiB, the program data requires 2MiB, the program dynamically allocates 8MiBon the heap, and the stack utilises 2MiB.How many page-table pages are required for this process? (Don’t answer with just a number, explain yourreasoning. Without your reasoning we cannot awardpart marks if your answer is incorrect.)6 marks (ii) Describe the lookup steps within the page tables to fndthe physical address of the logical address 0x00403004.(iii) If the reference time to access the physical memory frameis 20 nanoseconds. Assume that all required pages arein memory. How long does a paged memory referencetake, if—2 marks i. There is no TLB?2 marks ii. There is a TLB, with an access speed of 0.05 nanoseconds, but the TLB does not contain information onthe required page?3 marks iii. There is a TLB, with an access speed of 0.05 nanoseconds, and the TLB contains information on thispage?(Do not answer with just a number, explain your reasoning. Without your reasoning we cannot award partmarks if your answer is incorrect.)4Question 2 (marks 25)A fle is to be shared among different processes. The fle can beaccessed simultaneously by more than one process, up to a maximum of 5 processes. In pseudo-code write a monitor to coordinateaccess to the fle. For example:FileMonitor M;int main() {…M.RequestAccess();/* Access file: open, read, close, etc. */M.FinishedAccess();…}Monitor FileMonitor {/* monitor variables here */void RequestAccess() { /* Code here */ }void FinishedAccess() { /* Code here */ }}The monitor pseudo-code needs to defne monitor variables and themonitor functions.Notes• This is pseudo-code and not meant to be compiled and run.You will need to check the logic though.• This is a monitor so mutual-exclusion is assured and does notneed to be incorporated in the code.• Assume that the monitor uses Mesa condition variables.• As a starting point study Figure 5.19 (ed. 8, Figure 6.20)from the text book (Operating System Concepts, Silberschatzet el.).5Question 3 (marks 25)A two-way north-south highway through the mountains must passthrough a narrow tunnel with only one lane. A south-bound ornorth-bound car can pass through the tunnel only if, when it arrives, there are no on-coming cars in the tunnel. Note, due to thelength of the tunnel, at most 5 cars only are allowed in the tunnel at one time—provided that they are all heading in the samedirection.In pseudo-code write the two processes north2south and south2norththat allows cars to use the tunnel safely. As a starting point usethe code below.Hint: This is similar to the readers-writers problem except it issymmetric—north2south() is similar to south2north();Remember: All Semaphores and variables must be initialised./* Shared Data between all processes */Semaphore tunnel_mutex;/* Shared Data between south2north processes */Semaphore north_mutex;Semaphore going_north_max;int number_going_north;south2north(){/* Add Synchronisation code here */DriveNorthThroughTunnel();/* Add Synchronisation code here */}/* Shared Data between north2south processes */Semaphore south_mutex;Semaphore going_south_max;int number_going_south;north2south(){/* Add Synchronisation code here */DriveSouthThroughTunnel();/* Add Synchronisation code here */}6Question 4 (marks 25)Consider the following pseudo-code:/* Global memory area accessible by threads */#define N 100struct frame *emptyStack[N];struct frame *displayQueue[N];int main() {/*** Initialise by allocating the memory for N frames** And place the N frame addresses into the** empty Stack array*/Initialise();thread_t tid1, tid2;threadCreate(&tid1, GetFrame);threadCreate(&tid2, ShowFrame);sleep(300);}GetFrame() {struct frame *frame;struct frame local;while (1) {CameraGrab(&local); /* get a frame from the camerastore it in local */frame = Pop(); /* pop an empty-frame addressfrom the empty stack */CopyFrame(&local, frame); /* copy data from the localframe to the frame address */Enqueue(frame); /* push the frame address to} the display queue */}ShowFrame() {struct frame *frame;struct frame local;struct frame filtered;while (1) {frame=Dequeue(); /* pop the leading full framefrom the full queue */CopyFrame(frame, &local); /* copy data to the local frame */7Push(frame); /* push the frame addressto the empty stack */Solarise(&filtered, &local); /* Modify the image */VideoDisplay(&filtered); /* display the image */}}This program creates two threads, one calls GetFrame(), whichcontinually grabs frames from a camera, and the other thread callsShowFrame(), which continually displays the frames (after modifcation). When the program starts the emptyStack contains theaddresses of N empty frames in memory.The process runs for 5 minutes displaying the contents from thecamera.The procedures Pop() and Push() are maintaining the list of frameaddresses on the empty stack. Pop() removes a frame memoryaddress from the empty stack, and Push() adds a memory addressto the empty stack.The procedures Dequeue() and Enqueue() are maintaining thelist of frame memory addresses in the display queue in displayorder. Dequeue() removes the memory address of the next frameto display from the display queue, and Enqueue() adds a memoryaddress to the end of the display queue.The stack and the queue are the same size, and are large enoughto contain all available frame memory addresses.6 marks a. Without including synchronisation code problems will occur.Discuss what could potentially go wrong?5 marks b. Identify the critical sections in the above pseudo-code.14 marks c. Modify the above pseudo-code using semaphores only, to ensure that problems will not occur.Hint: this is a variation on the Producer-Consumer problemand will require similar semaphores.8


  • Hit The Order Button To Order A **Custom Paper**

>> 100% ORIGINAL PAPERS FROM AustralianExpertWriters.com <<