此方法在有线程池线程变得可用时执行。
The method executes when a thread pool thread becomes available.
每一个线程池线程可以同时运行一个任务。
你不能同时运行的线程池线程两个并发任务。
You cannot run two concurrent Tasks in the same thread-pool thread.
在线程池线程中,没有诸如未经处理的异常这样的内容。
There is no such thing as an unhandled exception on a thread pool thread.
讨论多线程的优缺点,并概括了可以创建线程或使用线程池线程的几种情形。
Discusses the advantages and drawbacks of multiple threads, and Outlines the scenarios in which you might create threads or use thread pool threads.
在所有线程池线程都分配到任务后,线程池不会立即开始创建新的空闲线程。
When all thread pool threads have been assigned to tasks, the thread pool does not immediately begin creating new idle threads.
当线程池线程准备好执行更多工作时,它将首先在其本地队列的开始部分查找,然后依次在全局队列和其他线程的本地队列中查找。
When a thread-pool thread is ready for more work, it first looks at the head of its local queue, then in the global queue, and then in the local queues of other threads.
一个常见的解决方案是使用VM启动时创建的线程池,而不是按需创建每个新线程。
One common workaround was to use a pool of threads created at VM startup, rather than creating each new thread on demand.
如果线程池太大,那么被那些线程消耗的资源可能严重地影响系统性能。
If a thread pool is too large, the resources consumed by those threads could have a significant impact on system performance.
调优适当的线程池以限制并发线程的数量。
Tuning the appropriate thread pools to restrict the number of concurrent threads.
与线程池的功能类似,TPL能够在线程和处理器之间实现负载均衡。
Like a thread pool, the TPL can perform load balancing across threads and processors.
正确管理线程池非常重要,因为线程对于服务器中的内存使用量以及其他低级操作系统资源而言是相当珍贵的资源。
Proper management of the thread pools is important, because threads are fairly expensive resources in terms of memory consumption in the server, as well as other low-level operating system resources.
如果您知道您的应用程序会立即使用大量线程池的线程,您必须提高最小线程数量。
If you know your application is going to need a lot of thread-pool threads right away, you can increase the minimum thread count.
运行于容器中的EJB在被分配到OR b线程池的线程中执行。
EJBs that are run within the container execute inside the threads that are allocated to the ORB thread pool.
消息侦听器服务配置为使用最大线程属性设置为4的线程池。
The message listener service is configured to use a thread pool that has the maximum threads property set to 4.
TPL还拥有一套从前的线程或线程池所不具备的新功能,例如任务拥有一个安全的Cancel方法。
The TPL also has a new set of features not seen in either threads or thread pools. For example, Tasks have a safe Cancel method.
对于同步用例,servlet引擎线程池有三个线程。
For the synchronous case, the servlet engine thread pool has three threads.
通用语言运行时(Common LanguageRuntime,CLR)以锁、线程和线程池的形式为并行编程提供基本的支持。
The Common Language Runtime has always had basic support for parallel programming in the form of locks, threads, and thread pools.
因此,我们通常需要保持很少数量的线程,但足够大的线程池可以满足服务器的性能和容量需求。
So we normally want to keep the number of threads small, though large enough to meet the performance and capacity requirements of the server.
您可能是为了方便而将线程组合,例如,一个线程池中的所有线程都属于组x,而另一个池的所有线程则属于组y,或者是为了访问控制而将线程进行组合。
You might group them for purposes of convenience — for instance, all the threads in a thread pool belong to group X, while those in another pool belong to group Y — or for access control.
您可能是为了方便而将线程组合,例如,一个线程池中的所有线程都属于组X,而另一个池的所有线程则属于组Y,或者是为了访问控制而将线程进行组合。
You might group them for purposes of convenience -- for instance, all the threads in a thread pool belong to group X, while those in another pool belong to group Y -- or for access control.
在这些情况下,需要一个组件范围的线程池,并在每个线程上具有固定的J2EE上下文。
In these cases, it is desirable to have a component-scoped thread pool, with a fixed J2EE context on each thread.
虽然线程池是构建多线程应用程序的强大机制,但使用它并不是没有风险的。
While the thread pool is a powerful mechanism for structuring multithreaded applications, it is not without risk.
如果活动线程的平均数时常接近线程池的最大大小,这说明该线程池太小,不足以满足工作量。
The pool is not large enough to serve the workload, if average number of active threads is constantly close to maximum size of the pool.
当然,直到它本身被应用程序释放之后,线程池才能释放线程。
Of course, it can't release them until the thread pool itself is released by the application.
每个工作线程都有适用于它的线程池创建程序组件的J2EE上下文。
Each worker thread has the J2EE context of the thread pool creator component applied to it.
执行自身形式的线程入池和线程调度的应用程序或库可能需要这种技术。
This technique might be required for applications or libraries that do their own form of thread pooling and thread dispatching.
试图向池线程传递任务的调用者都会发现池为空,在调用者等待一个可用的池线程时,它的线程将阻塞。
Any caller that attempted to pass a task to a pool thread would find the pool empty, and its thread would block while it waited for an available pool thread.
但是应用程序不拥有线程,而是由线程池拥有线程,因此线程池必须负责释放线程。
But the application doesn't own the threads; the thread pool does, and therefore the thread pool must take responsibility for releasing them.
不过,为避免应用程序之间发生严重的线程供给不足问题,可以配置一个线程池,允许线程的分配超出最大线程大小。
However, to avoid potentially severe thread starvation between applications, it is possible to configure a thread pool to allow thread allocation beyond maximum thread size.
应用推荐