Rabu, 20 Juli 2016

How to prioritize threads in java

In this article we will learn how to work with thread priorities when there are several threads competing for CPU time. Example code is also provided.   In a uni-processor system, when several threads are competing for the CPU, you might want a certain thread to get more CPU time (burst time) over the remaining threads. We can use thread priorities in such situation.   The thread class provides three final static variables (constants) namely: MIN_PRIORITY, NORM_PRIORITY, and MAX_PRIORITY whose values are 1, 5 and 10 respectively. Priority values can be in the range 1 to 10. 1 denotes minimum priority

The post How to prioritize threads in java appeared first on Coding Security.


How to prioritize threads in java
read more

Tidak ada komentar:

Posting Komentar