-4

First time asking questions at stackoverflow!

I've been asked to increase one Java application's priority to 15... I know that Thread class, Max_PRIORITY equals 10...

Scenario: This java application runs on a server which runs other C applications, all of them with realtime priority something like 15.

Thanks for the help!

Edit: Windows Server 2012 64 bits

Edit 2: They think that the java application is not getting too much cpu share, when compared too the C applications...

Edit 3: This java application needs to run at a realtime priority, like the c applications. 24 is their priorities, please forget when I told 15.

Roger
  • 1
  • 2
  • This is a job for the operating system. Thread priority is unlikely to correspond to process priority. That said, “15” is meaningless without context. What is 15? On what operating system is the Java application running? – VGR Jul 20 '17 at 13:01
  • Thread priority has nothing to do with process priority, and process priority is meaningless without telling us what operating system you're referring to. – user207421 Jul 20 '17 at 13:01
  • Sorry, I forget to do so. Windows Server 2012, 64 bits – Roger Jul 20 '17 at 13:03
  • Possible duplicate of [Some questions about Java Threads and Process Priorities](https://stackoverflow.com/questions/6416029/some-questions-about-java-threads-and-process-priorities) – Novaterata Jul 20 '17 at 13:15
  • Please guys check again, i just edited my question – Roger Jul 20 '17 at 13:25

2 Answers2

1

You should read more about the VM you are using in your office.

A regular Java thread has a priority range from 1 to 10. You can use a real time thread and can set its priority above 10. These regular java threads can be created using java.lang.Thread class

To create a realtime thread, you need a JVM that can work with javax.realtime package. You will have to download a jar which includes javax.realtime package. There aren't many RTSJ (Real time specification for Java) implementation. One such JVM that implements RTSJ is JamaicaVM.

Posix can allow you to create different thread scheduling policies and priorities. The SCHED_FIFO policy provides 99 different priority levels.

Below is a link where a Realtime thread has been created using the WebSphere Real Time VM.

https://www.ibm.com/developerworks/library/j-rtj3/index.html

lambad
  • 1,046
  • 10
  • 21
1

Just to supplement above answer,other Real time Java VM's are

  1. TimeSys RTSJ Reference Implementation
  2. IBM WebSphere Real Time
  3. OVM
  4. JamaicaVM
  5. jRate
  6. Aonix PERC
  7. Rockit Real-Time
  8. LJRT
  9. FijiVM

src: http://rtjava.blogspot.com