The problem of CallerRunsPolicy discard Strategy in Java Thread Pool ThreadPoolExecutor

CallerRunsPolicy discard policy in Java thread pool ThreadPoolExecutor means that the thread that starts the thread pool runs extra threads. What if the thread that starts the thread pool is running some extra thread and there is a bunch of extra threads behind it?

Jan.12,2022

to put it simply, the thread behind the queue is waiting there.

rejected tasks run in the main thread, so the main thread is blocked, and other tasks continue to be submitted to the thread pool for execution only after the rejected task has been executed.

you can refer to this https://www.jianshu.com/p/9fe.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31103-34113.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31103-34113.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?