Thread scheduling in java

I just want to ask that if the scheduling algorithm by JRE is priority scheduling since the threads are executed on the basis of their priority ,then is time slicing also made for the execution of threads because because of execution on the basis of priority may lead to starvation ,so I have confusion that is round robin scheduling algorithm implemented but as far as I know round robin scheduling has nothing to do with priority of threads since each thread is excecuted depending on the time slot.

So ,a lot of confusion in this case.

Replies

  • rahul69
    rahul69
    radha gogia
    I just want to ask that if the scheduling algorithm by JRE is priority scheduling since the threads are executed on the basis of their priority ,then is time slicing also made for the execution of threads because because of execution on the basis of priority may lead to starvation ,so I have confusion that is round robin scheduling algorithm implemented but as far as I know round robin scheduling has nothing to do with priority of threads since each thread is excecuted depending on the time slot.

    So ,a lot of confusion in this case.
    Don't get confused 😀
    It's simple:
    *JRE uses preemptive priority scheduling.
    *Also round robin scheduling is a type of preemptive scheduling.
    Scheduling is of two types: non preemptive (jobs run until completion) and preemptive (jobs can be force quit to give chance to others).
    Since both starred algo's given above are preemptive, both can rotate jobs, without jobs being fully completed, one considers priority also while preempting, while other(ie round robin) gives same priority to all jobs while preempting.
    Hope it clears a bit, 😀

You are reading an archived discussion.

Related Posts

Quote: NeuroMetrix, Inc. (Nasdaq: NURO) will unveil and demonstrate Quell, a novel wearable pain relief device at the 2015 International Consumer Electronics show (CES) January 6-9 in Las Vegas. Quell...
Hi all... Need some guidance regarding cdac Dvlsi course.. My C-CAT Rank is 770 and 327 mems are above my rank for dvlsi.. Can I expect admission in CDAC PUNE?...
Google researchers have went ahead and posted details about a Windows 8.1 vulnerability after the 90 days deadline it gave to Microsoft ended just days before new year eve. Google’s...
With days to go for Consumer Electronics Show 2015, Alcatel OneTouch has announced its CES launches. The company has sent out a press release teasing its new smartphone and smartwatch...
Hyundai has announced the launch of the smartwatch version of its Blue Link app which will let users control specific functions of their cars with the help of any Android...