有效使用线程池的准则。
使用线程池来完成 Runnable操作
Using a thread pool to work its way through the Runnable operations
如何使用线程池和多线程矩阵乘法的消息队列?
How to use thread pool and message queues in Multithreaded Matrix Multiplication?
使用线程池(thread pooling)。
讨论多线程的优缺点,并概括了可以创建线程或使用线程池线程的几种情形。
Discusses the advantages and drawbacks of multiple threads, and Outlines the scenarios in which you might create threads or use thread pool threads.
如果您要自己创建线程来处理生存期很短的任务,那么您绝对应该考虑使用线程池来替代。
If you find yourself creating threads to handle short-lived tasks, you should definitely consider using a thread pool instead.
在这种情况下你最好使用线程池最多包含一个特定的线程数量(例如说25)。
In this case you better use a thread pool which contains at most a specific number of threads (say for example 25).
对于解决方案隔离,则应该从另一个角度审视它们,确保作为不同解决方案组成部分的组件使用它们自己的线程池。
When it comes to solution isolation, you should look at it from the perspective of ensuring that components that are part of the different solutions use their own thread pool.
即使两个应用程序访问同一jca资源,它们也可以为该JCA资源定义两个不同的资源适配器,因此能够使用两个不同的线程池。
Even if two applications access the same JCA resource, they could also define two distinct resource adapters for that same JCA resource, and thus be able to use two distinct thread pools.
一个常见的解决方案是使用VM启动时创建的线程池,而不是按需创建每个新线程。
One common workaround was to use a pool of threads created at VM startup, rather than creating each new thread on demand.
因此,单个线程池可以由多个应用程序使用。
A single thread pool can therefore be used by multiple applications.
对代理和调用程序对象进行缓存,配合执行程序中的线程池,可以提高资源的使用效率。
The caching of proxy and invoker objects supported efficient use of resources, along with pooling of threads in the executor.
更重要的是,还可以定义哪个解决方案组件使用哪个总线,从而确保使用不同总线的解决方案组件也使用不同的线程池。
More importantly, you can also define which solution component USES which bus, thus ensuring that solution components using different buses also use different thread pools.
执行程序中应用了池,这可以有效地使用线程资源。
Pooling was applied in the executor to achieve efficient use of thread resources.
最后,对于与JCA资源适配器相关联的连接池,事实上可以对不同的资源适配器使用不同的线程池。
Finally, in the case of connection pools associated with JCA resource adapters, it is in fact possible to use a different thread pool for different resource adapters.
虽然线程池是构建多线程应用程序的强大机制,但使用它并不是没有风险的。
While the thread pool is a powerful mechanism for structuring multithreaded applications, it is not without risk.
开箱即用的实现就是。NET的线程池系统以及使用了异步上下文的框架。
Out of the box you one based on.net's thread pool system and one that USES the synchronization context framework.
如果您知道您的应用程序会立即使用大量线程池的线程,您必须提高最小线程数量。
If you know your application is going to need a lot of thread-pool threads right away, you can increase the minimum thread count.
消息侦听器服务配置为使用最大线程属性设置为4的线程池。
The message listener service is configured to use a thread pool that has the maximum threads property set to 4.
异步bean提供可以由多个应用程序使用的有效而又安全的全局线程池。
Asynchronous beans provides an efficient and safe global thread pool that can be used by multiple applications.
您还可以使用PerformanceAdvisors来获得关于线程池大小和其他设置的建议。
You can also use the Performance Advisors to get recommendations on thread pool sizes and other Settings.
作为计划的线程池的备选方法,可以考虑使用DelayQueue。
As an alternative to the scheduled thread pool, consider using a DelayQueue.
该包中的PooledExecut or类是一种有效的、广泛使用的以工作队列为基础的线程池的正确实现。
The PooledExecutor class from this package is an efficient, widely used, correct implementation of a thread pool based on a work queue.
如果您发现您的应用程序需要线程池,那么请考虑使用ut il . concurrent中的某个executor类,例如PooledExecutor,而不用从头开始编写。
If you find yourself in need of a thread pool for your application, consider using one of the Executor classes from util.concurrent, such as PooledExecutor, rather than writing one from scratch.
aspnet _ isapi模型创建固定数量的命名管道并且通过一个小的线程池使用重叠操作为并发的链接服务。
The aspnet_isapi module creates a fixed number of named pipes and USES overlapped operations to service simultaneous connections through a small pool of threads.
可以创建ThreadPoolStatusMBean,提供处理这些任务所使用的线程池的管理接口,并把它用JMX注册。
You can create a ThreadPoolStatus MBean to provide the management interface for the thread pool used to process these tasks and register it with JMX.
在使用自定义线程池(如ThreadPoolExecutor)时,可能不需要在单个J2EE上下文中运行工作。
When using a custom thread pool such as a ThreadPoolExecutor, it may not be desirable to run work within a single J2EE context.
使用Executors工具类来创建线程池,而不是直接调用ThreadPoolExecut or构造器来创建。
You don't call the ThreadPoolExecutor constructor directly to create a thread pool but instead use the Executors utility class to create one.
默认:当针对消息驱动bean的请求传入时,或者没有为特定传输链定义具体线程池时使用。
Default: Used when requests come in for a message driven bean or if a particular transport chain has not been defined to a specific thread pool.
您无须尝试编写您自己的线程池,这样做容易出错,相反您可以考虑使用ut il . concurrent中的一些实用程序。
Rather than try and write your own, which is easy to get wrong, you might consider using some of the utilities in util.concurrent.
应用推荐