• keeping track of how much time process has recently had

    From chinmayee.shenvi@gmail.com@21:1/5 to All on Sat Nov 25 11:10:57 2017
    On Thursday, December 21, 2006 at 11:20:27 PM UTC+5:30, sancho1980 wrote:
    hi
    i have a question regarding problem 45:

    modify the scheduler to keep track of how much cpu time each user
    process has had recently. when no task or server wants to run, pick the
    user process that has had the smallest cpu share

    i dont really understand whats mean with "how much time each user
    process has had RECENTLY"
    i did the following: i introduced the following variables in proc.c:

    clock_t recent_time[NR_TASKS + NR_PROCS], stopwatch;

    all elements are zeroed out in main()

    then, every time pick_proc() is called, this is done (right at the
    start):

    realtime = get_uptime();
    recent_time[proc_ptr->p_nr + NR_TASKS] = realtime - stopwatch;
    stopwatch = realtime;

    then, the next task (if ready) is picked round-robin-wise
    if no task is ready, that process is picked which has the lowest corresponding value in recent_time[]

    i'm not sure that's what is mean with the exercise
    ill be happy to read what you think

    thanx,

    martin








    Can you please post the source code for this problem 45, or mail it to me. It'll be really helpful. Thank You.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)