Welcome! Log In Create A New Profile

Advanced

Assignment 2: Question 1.4

Posted by rezrovs 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 2: Question 1.4
May 14, 2010 11:06AM
Ok, I'm stuck.

I'm pretty sure that I understand monitors and how they work but I'm struggling a bit with the wording of the question. What do they mean when they say 'implements an alarm clock'?

Also, this is what I do understand about the question
* some external hardware clock is what calls tick
* tick should be the part of the code that signals the x variable
* obviously T is how long you want the program to wait and the wait should happen in the delay method

So, how exactly do you get X to be delayed for the time specified? Can you just pass the time into the wait method?

Any suggestions would be greatly appreciated smiling smiley
avatar Re: Assignment 2: Question 1.4
May 15, 2010 11:32PM
From what I understand, the wait() operation suspends the process until signal() is invoked, so you can't pass wait an int to wait a specific time...so we have to find a different way to implement the delay?
Re: Assignment 2: Question 1.4
May 16, 2010 06:50PM
But if wait is just suspending the operation until signal is invoked, then you would have to have a counter somewhere to count the number of times that signal is invoked on the process and I'm not sure where in that code snippit that would go as I'm sure delay would only be called once. I think I'm just going to pass the int into the wait method and move on to the other questions and wait for the memo...
Sorry, only registered users may post in this forum.

Click here to login