One common workaround was to use a pool of threads created at VM startup, rather than creating each new thread on demand.
一个常见的解决方案是使用VM启动时创建的线程池,而不是按需创建每个新线程。
Further, the process will fail to create any new threads since no memory is available for creating new ones.
另外,进程将无法创建新的线程,因为无内存可供创建新线程使用。
This is a recipe for trouble because in some JVMs, creating a Thread is a heavyweight operation, and it's far better to reuse existing Threads than to create new ones.
这可以解决一些问题,因为在一些JVM 中,创建Thread是一项重量型的操作,重用现有 Thread比创建新线程要容易得多。
Otherwise, the built-in delay in creating new idle threads could cause a bottleneck.
否则,创建新空闲线程时的内置延迟可能导致出现瓶颈。
When all thread pool threads have been assigned to tasks, the thread pool does not immediately begin creating new idle threads.
在所有线程池线程都分配到任务后,线程池不会立即开始创建新的空闲线程。
Threads are sometimes called lightweight processes. Both processes and threads provide an execution environment, but creating a new thread requires fewer resources than creating a new process.
线程通常被看为一个轻量级的进程,进程和线程都有一个运行的环境,但是建立一个线程需要的资源更少。
Threads are sometimes called lightweight processes. Both processes and threads provide an execution environment, but creating a new thread requires fewer resources than creating a new process.
线程通常被看为一个轻量级的进程,进程和线程都有一个运行的环境,但是建立一个线程需要的资源更少。
应用推荐