4

I would like to create an OS scheduler implementation in Java (just for demonstration). I understand I can start threads, but after starting them I do not have control over their scheduling, and I would like to play with different scheduling algorithms.

I am willing to dig into the SDK to do some hacks, but is there an easier way?

Thanks in advance.


Just for the [duplicate] flaggers: yes, I found relevant links, but they do not answer how to do scheduling MANUALLY, i.e. from your own code. That seems to need JNI calls and use OS-specific thread management. There is no mention of this elsewhere, or please show me that link where this is discussed.

TFuto
  • 1,361
  • 15
  • 33
  • 5
    to the best of my knowledge java threads are backed by operating-system threads and so their scheduling isnt even done by the JVM. you can set priorities on them, which get translated to the underlying operating system, but no way to get full control that i know of – radai Dec 10 '13 at 11:49
  • Found answer for a differently worded relevant question: http://stackoverflow.com/questions/2816011/what-is-the-jvm-scheduling-algorithm – TFuto Dec 10 '13 at 11:53
  • 1
    Scheduling actually is not JVM's task, it is OS which decides scheduling schemes. You can implement new schemes in some open OS like Linux. – Narendra Pathai Dec 10 '13 at 12:50

0 Answers0