Results 1 to 3 of 3
  1. #1
    rootnet47 is offline Member
    Join Date
    May 2011
    Posts
    14
    Rep Power
    0

    Question How does OS manages Two threads with the same priority?

    Hi! I'm new to Java as well as Linux system. Before it I used Windows OS. Well, when a program contains two threads with same priority, how do the Operating Systems (Linux and Windows) manage CPU cycles.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,544
    Rep Power
    23

    Default

    Some can round robin giving each an equal usage.
    Google can probably tell you the algorithm each OS uses.

  3. #3
    perfect5085 is offline Member
    Join Date
    Aug 2011
    Location
    HangZhou, China
    Posts
    4
    Rep Power
    0

    Default

    do you care about java thread? or OS thread?
    For the java, you can set the thread priority with Thread.setPriority().

Similar Threads

  1. priority
    By simorgh in forum Threads and Synchronization
    Replies: 4
    Last Post: 01-07-2012, 12:49 AM
  2. Priority Queue
    By fam2315 in forum New To Java
    Replies: 5
    Last Post: 06-29-2011, 03:10 AM
  3. Priority Queue with explicit priority
    By lsk in forum Advanced Java
    Replies: 4
    Last Post: 06-10-2011, 07:16 PM
  4. peemptive priority
    By IT student in forum New To Java
    Replies: 4
    Last Post: 04-09-2010, 02:52 PM
  5. How to get/set thread priority
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:40 PM

Tags for this Thread

Posting Permissions

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