Thread: Scheduling

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    32

    Scheduling

    I am trying to solve a question about scheduling using Round Robin. I was able to answer most of the parts but I am badly stuck on two parts:
    Code:
     Quantum = 3 time units
    Process arrival time = 0
    
    CPU burst - 4 time units
    I/O burst  - 5 time units
    CPU burst - 8 time units
    I/O burst  - 6 time units
    CPU burst - 10 time units
    I have to state the transitions it will go through and indicate if it is voluntary or not.

    AND

    If the process attempts a division by zero in the third time unit of the second CPU burst what change will it have on the lifetime of the process.

    Please help me..
    Thanx
    Jules

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Erm, what's the difficulty?

    > CPU burst - 4 time units
    4-3 = 1
    Control released unvoluntarily

    ditto for the other events

    Then next time around its
    1-3 = 0
    Control released voluntarily (normal exit)

    Lather, rinse and repeat until everything is at zero time remaining.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2004
    Posts
    32
    I knew it sounded silly...but I am just learning about it...what about the division by zero?? I dont get it

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > CPU burst - 8 time units
    Well it successfully subtracts 3 twice right - leaving 2

    So in the 3rd pass, it will either use all two ticks and finish normally, or use <2 and divide-by-zero

    Either way, it's game over for this thread.

    As to whether zero-divide is voluntary or not, well that depends on your definitions
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jan 2004
    Posts
    32
    Okay....Im Dumb It says to assume that the process completes execution in the three CPU bursts. So is this what happens

    CPU burst - 4 time units
    1st time around -> involuntary (1 remaining)
    2nd time around -> voluntary (0 remaining)

    I/O burst - 5 time units
    1st time around -> involuntary (2 remaining)
    2nd time around -> voluntary (0 remaining)

    CPU burst - 8 time units
    1st time around -> involuntary (5 remaining)
    2nd time around -> involuntary (2 remaining)
    3rd time around -> voluntary (0 remaining)

    I/O burst - 6 time units
    1st time around -> involuntary (3 remaining)
    2nd time around -> voluntary (0 remaining)

    CPU burst - 10 time units
    1st time around -> involuntary (7 remaining)
    2nd time around -> involuntary (4 remaining)
    3rd time around -> involuntary (1 remaining) ???? what happens

    I am so sorry for this...pls forgive me...I really do feel stupid

    So if it does a divide by zero then the process will not be able to complete execution???

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. scheduling in linux
    By anjana in forum Linux Programming
    Replies: 2
    Last Post: 05-24-2007, 03:48 PM
  2. Flight scheduling algorithm?
    By ChadJohnson in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 01-26-2006, 02:23 AM
  3. Round Robin Scheduling using c.
    By eclipt in forum C Programming
    Replies: 8
    Last Post: 12-28-2005, 04:58 PM
  4. Scheduling a program/function execution?
    By Aedile in forum Linux Programming
    Replies: 1
    Last Post: 08-12-2005, 10:19 AM
  5. Scheduling Algo
    By BigDaddyDrew in forum C++ Programming
    Replies: 41
    Last Post: 03-08-2003, 11:00 AM