Is thread starvation deadlock happening here in the code?

后端 未结 3 2179
孤城傲影
孤城傲影 2020-12-30 17:37
//code taken from java concurrency in practice

  package net.jcip.examples;

import java.util.concurrent.*;


public class ThreadDeadlock
       {
    ExecutorServi         


        
3条回答
  •  北海茫月
    2020-12-30 18:08

    The reason is not very obvious from the code itself but from the original book where the code is copied from: RenderPageTask submits two additional tasks to the Executor to fetch the page header and footer...

    If the RenderPageTask were a task independent from the newSingleThreadExecutor, there would be no deadlock at all.

提交回复
热议问题