Newsgroups: comp.os.minix
Subject: Re: study project.
References: <8i5eto$n1n$1@supernews.com>
Organization: Rochester Institute of Technology, Rochester, NY
From: aje9383@osfmail.isc.rit.edu (Andrew Erickson)
NNTP-Posting-Host: grace.isc.rit.edu
X-Original-NNTP-Posting-Host: grace.isc.rit.edu
Message-ID: <39464765@news.isc.rit.edu>
Date: 13 Jun 2000 10:38:29 -0500
X-Trace: 13 Jun 2000 10:38:29 -0500, grace.isc.rit.edu
Lines: 32
XPident: aje9383
X-Original-NNTP-Posting-Host: 129.21.4.100
XPident: Unknown
Path: news.adfa.oz.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feeder.qis.net!newsfeed.nyu.edu!news-nysernet-16.sprintlink.net!news.sprintlink.net!news.isc.rit.edu!aje9383
Xref: news.adfa.oz.au comp.os.minix:35401

In article <8i5eto$n1n$1@supernews.com>, Nick <wendynic1@lineone.net> wrote:
>Hi,
>    i have a question about on changing process scheduling in minix, i have
>change the Round Robin to FCFS, now i want to do a hard job on SJF- Short
>Job First. but i don't know how to calculate the burst time of each process,
>any suggestion ??

It's easy to find out which job is the shortest--simply time all the jobs,
and the one which takes the least time is the shortest.

It's impossible, in the general case, to find out what job is the shortest
without actually running them to completion.  (It's actually impossible, in
the general case, to determine if a job has a finite or infinite length;
this is the well-known halting problem.)  For that reason, SJF is not useful
under many conditions.  It's primarily used where you have a good idea of
how long a job takes from past runs of the job--typically, this means
repetitive batch jobs.  A company payroll, for instance, probably takes
about the same length of time every week; some real-time processes likewise
have known time bounds.  (Think of an airplane control system--it's good to
make absolutely sure that you'll be able to run the rudder positioning
process twenty times every second, so the system is designed to ensure that
it will happen.  Nobody wants to be flying in an airplane where the controls
might not respond....)

For interactive processes, it's frequently impossible to even guess how long
a process will take.  There is no reasonable way for the kernel to know the
difference between cc tinyprog.c and cc hugeprog.c, even though we know the
former takes much less time than the latter.

Hope this helps (a bit),
-- 
Andrew Erickson
