• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unix scheduler in java  RSS feed

 
Wanki Ho
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an assignment to write a Unix scheduler in java and I'm not altogether sure about how to go about doing this as our instructor was very vague and didn't give us many specifications.
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scheduler as in crontab or at command? If you want a simple one, you can check out the thread package (I believe it's timer class).
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or perhaps a calendering (appointment scheduling) program?
Or implement some particular UNIX process scheduling algorithm as a sort of demo?
Or something else entirely?
I never understand why people will come here to ask about an assignment that was unclear. You're presumably paying for an education: the instructor owes you a clear, detailed description of what's expected of you. Go ask him/her for it, and ask for details until you understand. Then you're absolutely welcome to come back here and ask for help!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by a Unix scheduler?
 
Wanki Ho
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should have been more specific. It's a Unix CPU process scheduler. I don't know how many different kinds of Unix schedulers there are, but I'm guessing it's the default one for the Unix system. It's a priority based scheduler with 64 different priority levels that goes through each process for a certain time slice and than reinserts them back into the array with a lower priority level based on some algorithm.
I've never programmed anything like this with threads, it's pretty alien to me. I wish I could get my hands on some source code with a few examples of process schedulers.
How do I run a demo to prove my scheduler works? What would I use for threads? So far I'm just using some nonsense worker threads that go through 10,000 iterations of a loop.
How do I give a thread a priority range from 0-64?
The basic data structure I've decided to work with is an Arraylist with 64 circular array queues. I don't know if this is right.
Unix schedulers are supposed to switch threads whenever one with a higher priority becomes available. How do you do that?
Should the scheduler program itself be a thread or a while loop?
I would appreciate any tips.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!