开发者

The thread created with newSingleThreadExecutor a newly created thread or a deamon thread?

want to the type of the thread created by newSingleThreadExecutor. http://download.oracle.com/javase/1.5.0/docs/guide/concurrency/overview.html shows we can 开发者_如何学JAVAcreate thread in a single background thread (as with events in Swing) or in a newly created thread. But how to control?


The documentation of newSingleThreadExecutor() specifies that it is (almost) the same as using newFixedThreadPool(1), so each call to that method will create an executor with its own thread. That thread will not be a daemon thread by default, but you could change that by providing your own ThreadFactory that produces daemon threads.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜