Results 1 to 6 of 6
  1. #1
    snehil2009 is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default non preemptive scheduling.....challenging!!

    i want a program to calculate waiting time of each process in non preemptive scheduling, given their arrival time and burst time. Can someone help me for this??

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default

    There are a lot more details you have to fill in:

    - does a thread/process run from start to finish without relinguishing control?
    - what is the scheduling algorithm for submitted processes?
    - does it take time to start and clean up a process?

    kind regards,

    Jos

  3. #3
    snehil2009 is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default rep

    Write a program to list the waiting time of the processes based on the arrival time and the burst time under non preemptive scheduling. In the Non Preemptive Scheduling, the current process keeps the CPU until it releases the CPU by terminating. The operating system never initiates a context switch from a running process to another process.

    when there is more than one processes waiting for the CPU, the process which will release the cpu first by calculating the sum of arrival time and burst time, will be allocated.

    Input
    int process[] = {1, 2, 3, 4}
    int arrival[] = {0, 2, 4, 5}
    int burst[] = {7, 4, 1, 4}
    Output
    The function getWaitingList() returns {0, 6, 3, 7}
    Explanation:
    process 1 3 2 4
    0 7 8 12 16 Start time of the process
    The waiting time should be: 0, 6, 3, 7

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,436
    Blog Entries
    7
    Rep Power
    20

    Default

    Ah, this is homework, there is nothing challenging about it; so, what have you done yourself so far?

    kind regards,

    Jos

  5. #5
    snehil2009 is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default rep

    actually i am very new to java with a very little programming experience, i hav no idea how to solve this. Its my university assignment. Kindly help me to find a solution 4 this

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Erm, the question asked was "what have you done yourself so far?"

Similar Threads

  1. challenging problems
    By jayant3001 in forum JCreator
    Replies: 24
    Last Post: 10-30-2008, 05:41 AM
  2. Replies: 24
    Last Post: 07-29-2008, 04:04 PM
  3. Quartz scheduling in EJB3
    By Niveditha in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 06-30-2008, 08:34 AM
  4. Scheduling tasks using Threads
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-11-2007, 10:24 AM
  5. Scheduling a task
    By bugger in forum Advanced Java
    Replies: 3
    Last Post: 12-04-2007, 12:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •