A significant risk in all kinds of thread pools is thread leakage, which occurs when a thread is removed from the pool to perform a task, but is not returned to the pool when the task completes.
各种类型的线程池中一个严重的风险是线程泄漏,当从池中除去一个线程以执行一项任务,而在任务完成后该线程却没有返回池时,会发生这种情况。
Any caller that attempted to pass a task to a pool thread would find the pool empty, and its thread would block while it waited for an available pool thread.
试图向池线程传递任务的调用者都会发现池为空,在调用者等待一个可用的池线程时,它的线程将阻塞。
MapLeaker processes tasks in a thread pool and records the status of each task in a Map.
MapLeaker在线程池中处理任务,并在一个map中记录每一项任务的状态。
应用推荐