It's UWAweek 10 (1st semester, week 2)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 1168 articles.
Currently 4 other people reading this forum.


 UWA week 35 (2nd semester, week 6) ↓
SVG not supported

Login to reply

👍?
helpful
12:11pm Wed 30th Aug, Christopher M.

ANONYMOUS wrote:
> I have been experimenting with different command-files with the sample solution and have a few questions regarding the wait system call. I understand that if wait is called when there are no child processes left, the process will be put back on the ready queue. In the sample solution, if there are no processes in the ready queue, the process that called wait is still put back into the ready queue and then back into running consuming a total of 15 usecs. Is this what is meant to happen? I had assumed that if there were no processes in the ready queue, the process that called wait would just keep running until the time quantum is reached. (It seemed terribly inefficient to move the process off the running state just to put it back in again).
The decision to determine if the 'waiting' process has any children to wait for is made by the OS. The OS requires the use of the CPU to execute code to make that decision. The process invoking the 'wait' needs to be placed somewhere so that the OS can get the CPU. There is an analogous situation when a process exhausts its timequantum and there's no other process to take its place (that can be determined by looking only at the count of Ready processes). At present (in the sample) that 'exhausted' process stays on the CPU for a new timequantum but, maybe for consistency, it too should be moved to Ready and then back to Running. Thinking on it, but I'm leaning toward a simple solution, rather than one that strives for maximum efficiency of our simulated system.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy