软件包 | 描述 |
---|---|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
java.nio.channels.spi |
为
java.nio.channels 包服务提供商类。
|
java.nio.file.spi |
为
java.nio.file 包服务提供商类。
|
java.util.concurrent |
在并发编程中常用的实用类。
|
Modifier and Type | Method and Description |
---|---|
static AsynchronousFileChannel |
AsynchronousFileChannel.open(Path file, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)
打开或创建一个用于读取和/或写入的文件,返回一个异步文件通道来访问该文件。
|
static AsynchronousChannelGroup |
AsynchronousChannelGroup.withCachedThreadPool(ExecutorService executor, int initialSize)
创建一个异步信道组,一个给定的线程池,创建新的线程,需要。
|
static AsynchronousChannelGroup |
AsynchronousChannelGroup.withThreadPool(ExecutorService executor)
创建一个给定线程池的异步信道组。
|
Modifier and Type | Method and Description |
---|---|
abstract AsynchronousChannelGroup |
AsynchronousChannelProvider.openAsynchronousChannelGroup(ExecutorService executor, int initialSize)
用给定的线程池构造一个新的异步信道组。
|
Modifier and Type | Method and Description |
---|---|
AsynchronousFileChannel |
FileSystemProvider.newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)
打开或创建一个用于读取和/或写入的文件,返回一个异步文件通道来访问该文件。
|
Modifier and Type | Interface and Description |
---|---|
interface |
ScheduledExecutorService
一个
ExecutorService 可以调度命令后运行一个给定的延迟,或定期执行。
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractExecutorService
提供
ExecutorService 执行方法的默认实现。
|
class |
ForkJoinPool
运行一个
ExecutorService
ForkJoinTask s。
|
class |
ScheduledThreadPoolExecutor
一个
ThreadPoolExecutor 可以另外安排的命令来运行在一个给定的延迟,或定期执行。
|
class |
ThreadPoolExecutor
一个
ExecutorService 执行每个提交的任务使用一个可能几个池线程,使用
Executors 工厂方法通常配置。
|
Modifier and Type | Method and Description |
---|---|
static ExecutorService |
Executors.newCachedThreadPool()
创建一个线程池,根据需要创建新的线程,但在可用时将重用先前构建的线程。
|
static ExecutorService |
Executors.newCachedThreadPool(ThreadFactory threadFactory)
创建一个线程池线程创建新的需要,但会重用以前构建的线程可用时,使用所提供的threadfactory创建新线程时,需要。
|
static ExecutorService |
Executors.newFixedThreadPool(int nThreads)
创建一个线程池,使用固定数量的线程操作了共享无界队列。
|
static ExecutorService |
Executors.newFixedThreadPool(int nThreads, ThreadFactory threadFactory)
创建一个线程池,使用固定数量的线程操作了共享无界队列,使用提供的threadfactory创建新线程时,需要。
|
static ExecutorService |
Executors.newSingleThreadExecutor()
创建一个执行器,使用一个单一的工作线程操作关闭一个无限的队列。
|
static ExecutorService |
Executors.newSingleThreadExecutor(ThreadFactory threadFactory)
创建一个执行器,采用单线程操作了无界队列,并使用所提供的threadfactory创建新线程需要时。
|
static ExecutorService |
Executors.newWorkStealingPool()
创建一个工作线程池使用偷
available processors 为目标的并行度。
|
static ExecutorService |
Executors.newWorkStealingPool(int parallelism)
创建一个线程池,保持足够的线程来支持给定的并行级别,并可以使用多个队列来减少争用。
|
static ExecutorService |
Executors.unconfigurableExecutorService(ExecutorService executor)
返回一个对象,代表所有定义的
ExecutorService 方法指定遗嘱执行人,但没有任何其他的方法,否则可能会使用投。
|
Modifier and Type | Method and Description |
---|---|
static ExecutorService |
Executors.unconfigurableExecutorService(ExecutorService executor)
返回一个对象,代表所有定义的
ExecutorService 方法指定遗嘱执行人,但没有任何其他的方法,否则可能会使用投。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.