Results 1 to 5 of 5
  1. #1
    IT student is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default peemptive priority

    hello gues
    how are you
    I have a problem to make assignment in operating system
    to wite code about preemptive priority (cpu schedual)
    any one help me to complet this code
    note (priority preemptive mean each process with high priority has ability to start excution than the other whoes priority is low>>
    this code what I try to write,,,


    Java Code:
    import java.util.Scanner;
      public class BinaryHeap{
      public static void main(String[]args){
     int process;
        int arrivaltime;
        int bursttime;
        int priority;
        Scanner scan=new Scanner(System.in);
        for(process=1;process<5;process++){
          process=scan.nextInt();
        }
        for(arrivaltime=0;arrivaltime<5;arrivaltime++){
          arrivaltime=scan.nextInt();
        while (arrivaltime=0)
        
          system.out.print(arrivaltime);}}}
    Last edited by Eranga; 04-09-2010 at 02:47 PM. Reason: added code tags

  2. #2
    IT student is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    No one can help me please>>

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Please use code tags next time posting. And also please keep in mind that no one here to do your assignment. You must put some effort first of all.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    I can see few errors in your code.

    The following is incorrect.

    Java Code:
    while (arrivaltime = 0) {
    Compiler expecting a Boolean validation/value, not an assignment. Change into the following.

    Java Code:
    while (arrivaltime == 0) {

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by IT student View Post
    hello gues
    how are you
    I have a problem to make assignment in operating system
    to wite code about preemptive priority (cpu schedual)
    any one help me to complet this code
    note (priority preemptive mean each process with high priority has ability to start excution than the other whoes priority is low>>
    this code what I try to write,,,
    Can you explain bit more what you want to do exactly. Seems to me your code is nothing doing anything useful.

Similar Threads

  1. priority
    By simorgh in forum Threads and Synchronization
    Replies: 4
    Last Post: 01-07-2012, 12:49 AM
  2. Priority Queue Question
    By Taz_84 in forum New To Java
    Replies: 0
    Last Post: 01-29-2009, 03:23 AM
  3. How to implement Priority queue with Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-12-2008, 08:49 PM
  4. How to get/set thread priority
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:40 PM
  5. Replies: 0
    Last Post: 04-02-2008, 07:04 AM

Posting Permissions

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