The priority of java thread, the concept of daemon thread

1. Thread scheduling

Preemptive scheduling
Non-preemptive scheduling

1.1 Preemptive Scheduling

insert image description here
The higher the priority, the higher the probability of grabbing the CPU
insert image description here
insert image description here

1.2 Daemon threads

Daemon thread, non-daemon thread. When other non-daemon threads finish executing, the daemon threads will end one after another.
insert image description here
Application Scenarios of Daemon Threads
insert image description here

Guess you like

Origin blog.csdn.net/weixin_44860226/article/details/132253234