YouTube Channel
/ codewithnaval
Hi
I am Navalchand Rajupt . Welcome to our YouTube channel CodeWithNaval.
➤𝗧𝗢𝗣𝗜𝗖𝗦 𝗖𝗢𝗩𝗘𝗥𝗘𝗗
________________________________________________________________________
Def:-Thread scheduler in java is the part of the JVM.
Thread Scheduler only decides which thread should be run.
There is no guarantee that which runnable thread will be chosen thread scheduler for run.
If there is higher/lover priority thread then first thread scheduler chose higher priority thread. But it’s not guaranty every time thread scheduler chose thread priority wise
It’s depend on JVM.
Arrival timeThe thread scheduler also depends on the arrival time of the thread.
Same priority thread Execute like “FCFS”
In a single process Only one thread run at a time.
Thread Priority
Each thread have a priority. Priorities are represented by a number between 1 and 10. In most cases, thread scheduler schedules the threads according to their priority.
But not every time depend on JVM.
Three constants Priority defined in Thread class.
public static int MIN_PRIORITY
public static int NORM_PRIORITY
public static int MAX_PRIORITY
Default priority of a thread is 5 (NORM_PRIORITY).
The value of MIN_PRIORITY is 1 and the value of MAX_PRIORITY is 10.
public int getPriority():
returns the priority of the thread.
public int setPriority(int priority):
changes the priority of the thread.
______________________________________________
👉𝐅𝗢𝗟𝗟𝗢𝗪 𝗠𝗘 𝗢𝗡 𝗜𝗡𝗦𝗧𝗔𝗚𝗥𝗔𝗠:
https://www.instagram.com/codewithnav...
______________________________________________________
➤𝐉𝐚𝐯𝐚 𝐅𝐫𝐞𝐞 𝐂𝐨𝐮𝐫𝐬𝐞 𝐀𝐥𝐥 𝐕𝐢𝐝𝐞𝐨𝐬
1. 𝑾𝒉𝒂𝒕 𝒘𝒆 𝒍𝒆𝒂𝒓𝒏 𝒊𝒏 𝒕𝒉𝒊𝒔 𝑱𝒂𝒗𝒂 𝑪𝒐𝒖𝒓𝒔𝒆. :-
___________
➤𝐇𝐚𝐬𝐡𝐭𝐚𝐠
#codewithnaval #java #javafreecourse #naval #programmingcourse #javaplaylist #javainstall
#javabycodewithnaval #javabycodewithnavalpart #javatutorial #corejavatutorial
______________________________________________________
____________________
➤𝗖𝗛𝗔𝗡𝗡𝗘𝗟 𝗧𝗔𝗚𝗦
►codewithnaval
►codebynaval
►codder
►naval
____________________
➤𝗔𝗕𝗢𝗨𝗧
Please Subscribe & Press The Bell Icon To Get Updates On Upcoming Videos. Here You Will Learn Programming Language, Interview Preparation, Challenging Task and many more
____________________
➤𝐂𝐨𝐧𝐭𝐚𝐜𝐭 𝐔𝐬-
[email protected]
➤𝗧𝗵𝗮𝗻𝗸𝘀 𝗙𝗼𝗿 𝗪𝗮𝘁𝗰𝗵𝗶𝗻𝗴😊