Because the pattern demonstrated above is so effective, it is relatively simple to extend it by chaining additional thread pools with queues.
因为上面介绍的模式非常有效,所以可以通过连接附加线程池和队列来进行扩展,这是相当简单的。
In this example, I don't focus on other issues related to this pattern, such as synchronization to make it thread safe.
在此实例中,我并没有针对其他与此模式相关的问题,如保持同步以确保线程安全。
Since it is thread safe by design, you might cache it in a public static final variable, or wrap it in a singleton pattern after creation for later access.
因为根据设计它是线程安全的,创建它之后可以把它缓存在一个公共静态最终变量中,或者包装在单实例模式中以供以后访问。
应用推荐