Results 1 to 5 of 5

Thread: priority

  1. #1
    simorgh is offline Member
    Join Date
    Jan 2010
    Posts
    25
    Rep Power
    0

    Default priority

    Thread API priority translation to OS thread priority ! - Stack Overflow
    Solaris

    * 1 ⇒ 0
    * 2 ⇒ 32
    * 3 ⇒ 64
    * 4 ⇒ 96
    * 5 10 ⇒ 127

    Of note is that on Solaris, you can't raise the thread priority above normal, only lower it: the priority value for 5 is the same as any of the higher values.
    Linux

    * 1 10 ⇒ 4 -5 (nice values)

    Of note is that on Linux, different thread priorities in Java do map to distinct priority values at native level.
    Windows

    * 1 2 ⇒ THREAD_PRIORITY_LOWEST
    * 3 4 ⇒ THREAD_PRIORITY_BELOW_NORMAL
    * 5 6 ⇒ THREAD_PRIORITY_NORMAL
    * 7 8 ⇒ THREAD_PRIORITY_ABOVE_NORMAL
    * 9 10 ⇒ THREAD_PRIORITY_HIGHEST


    In linux , Is it overhead windows? I mean 10 is the highest priority in windows , But in linux , is it the lowest priority?



    Another question:

    What is Java 'thread priority'?

    In this site there is a table that shows priorities in windows

    Is this table is similar for all windows versions?

    Dose anyone knows priority for different version of windows?(VISTA .7. XP and..)

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Java's virtual machine sits on top of the OS and uses OS resources, such as threads. Since Java is OS independent, Java has to map some of its settings to OS settings in the VM. In the case of thread priority, each OS handles thread priority quite differently. The documentation you quoted shows some of the mappings.

    I don't know for sure, but I suspect that the different versions of Windows define thread priorities the same way.

  3. #3
    simorgh is offline Member
    Join Date
    Jan 2010
    Posts
    25
    Rep Power
    0

    Default

    I don't know for sure, but I suspect that the different versions of Windows define thread priorities the same way.
    With all due respect, You idea isn't right.

    The columns are actual priority levels, only 22 of which must be shared by all applications. (The others are used by NT itself.) The rows are priority classes. The threads running in a process pegged at the idle priority class are running at levels 1 through 6 and 15, depending on their assigned logical priority level.
    http://www.javaworld.com/javaworld/jw-09-1998/jw-09-threads.html



    For example, Windows 2000 has 7 priority levels that are not fixed, so the mapping is indeterminate
    Thinking in Java 13: Concurrency - Priority

  4. #4
    neilcoffey is offline Senior Member
    Join Date
    Nov 2008
    Posts
    286
    Rep Power
    7

    Default

    In case it's of any use, I put together some information a while back on how Java thread priorities map to OS thread priorities under Windows and Linux. (In Linux, they actually map specifically to nice values.)

    It's worth noting that (a) the mapping changed subtly between Java 5 and Java 6; and (b) thread "priority" really means slightly different things in Windows vs Linux.

  5. #5
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default Ugg Boots Cheap

    drOJHiNB, Cheap Ugg Boots ,WRYfBXbS, <a href=http://cheap-ugg-boots-onlines.com>Ugg Boots For Cheap</a> ,xQgvPLeE, Cheap Ugg Boots, Ugg Boots For Cheap USA, Free Shipping! Ugg Boots For Cheap , tSwnLrPH

Similar Threads

  1. how high-priority thread allow other thread
    By rameshkr in forum Threads and Synchronization
    Replies: 4
    Last Post: 10-15-2009, 11:46 PM
  2. Priority Queue Question
    By Taz_84 in forum New To Java
    Replies: 0
    Last Post: 01-29-2009, 04:23 AM
  3. How to implement Priority queue with Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-12-2008, 09:49 PM
  4. How to get/set thread priority
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 07:40 PM
  5. Replies: 0
    Last Post: 04-02-2008, 08: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
  •