About: Thread pool

An Entity of Type: Abstraction100002137, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org

In computer programming, a thread pool is a software design pattern for achieving concurrency of execution in a computer program. Often also called a replicated workers or worker-crew model, a thread pool maintains multiple threads waiting for tasks to be allocated for concurrent execution by the supervising program. By maintaining a pool of threads, the model increases performance and avoids latency in execution due to frequent creation and destruction of threads for short-lived tasks. The number of available threads is tuned to the computing resources available to the program, such as a parallel task queue after completion of execution.

Property Value
dbo:abstract
  • في برمجة الحاسوب، يعد تجميع الخيوط (بالإنجليزية: thread pool)‏ أحد أنماط تصميم البرمجيات لتحقيق تزامن التشغيل في برنامج حاسوبي ما. (ar)
  • In computer programming, a thread pool is a software design pattern for achieving concurrency of execution in a computer program. Often also called a replicated workers or worker-crew model, a thread pool maintains multiple threads waiting for tasks to be allocated for concurrent execution by the supervising program. By maintaining a pool of threads, the model increases performance and avoids latency in execution due to frequent creation and destruction of threads for short-lived tasks. The number of available threads is tuned to the computing resources available to the program, such as a parallel task queue after completion of execution. (en)
  • Un thread pool in programmazione indica un gestore software di thread utilizzato per ottimizzare e semplificare l'utilizzo dei thread all'interno di un programma. (it)
  • Trådpool (från engelskans thread pool) är ett designmönster som består av ett antal trådar (m) som skapas för att utföra ett antal uppgifter samtidigt (n). Vanligtvis motsvarar m inte n; istället är antalet trådar inställt till de tillgängliga datorresurserna för att hantera uppgifterna parallellt (processorer, kärnor, minne) medan antalet uppgifter beror på problemet och kanske inte är känt i förväg. Anledningar till att använda en trådpool, istället för att skapa en tråd per uppgift, är att förhindra overhead för tid och minne när trådar skapas, samt för att undvika att få slut på resurser såsom öppnade filer eller nätverksanslutningar (där operativsystem allokerar ett begränsat antal för att köra program). Ett vanligt sätt att distribuera uppgifterna till trådar (schemalägga uppgifterna att köras) är med hjälp av en synkroniserad kö, känd som en uppgiftskö (från engelskans task queue). Trådarna i poolen plockar uppgifter från kön, utför dem och sedan returnerar dem till kön för nästa uppgift. (sv)
  • 线程池(英語:thread pool):一种线程使用模式。线程过多会带来调度开销,进而影响缓存局部性和整体性能。而线程池维护着多个线程,等待着监督管理者分配可并发执行的任务。这避免了在处理短时间任务时创建与销毁线程的代价。线程池不仅能够保证内核的充分利用,还能防止过分调度。可用线程数量应该取决于可用的并发处理器、处理器内核、内存、网络sockets等的数量。 例如,对于计算密集型任务,线程数一般取cpu数量+2比较合适,线程数过多会导致额外的线程切换开销。 任务调度以执行线程的常见方法是使用同步队列,称作任务队列。池中的线程等待队列中的任务,并把执行完的任务放入完成队列中。 线程池模式一般分为两种:HS/HA半同步/半异步模式、L/F领导者与跟随者模式。 * 半同步/半异步模式又称为生产者消费者模式,是比较常见的实现方式,比较简单。分为同步层、队列层、异步层三层。同步层的主线程处理工作任务并存入工作队列,工作线程从工作队列取出任务进行处理,如果工作队列为空,则取不到任务的工作线程进入挂起状态。由于线程间有数据通信,因此不适于大数据量交换的场合。 * 领导者跟随者模式,在线程池中的线程可处在3种状态之一:领导者leader、追随者follower或工作者processor。任何时刻线程池只有一个领导者线程。事件到达时,领导者线程负责消息分离,并从处于追随者线程中选出一个来当继任领导者,然后将自身设置为工作者状态去处置该事件。处理完毕后工作者线程将自身的状态置为追随者。这一模式实现复杂,但避免了线程间交换任务数据,提高了CPU cache相似性。在ACE(Adaptive Communication Environment)中,提供了领导者跟随者模式实现。 线程池的伸缩性对性能有较大的影响。 * 创建太多线程,将会浪费一定的资源,有些线程未被充分使用。 * 銷毀太多執行緒,將導致之後浪費時間再次創建它們。 * 创建线程太慢,将会导致長時間的等待,性能變差。 * 銷毀執行緒太慢,导致其它執行緒资源饥饿。 (zh)
dbo:thumbnail
dbo:wikiPageExternalLink
dbo:wikiPageID
  • 764016 (xsd:integer)
dbo:wikiPageLength
  • 6717 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1061635285 (xsd:integer)
dbo:wikiPageWikiLink
dbp:date
  • December 2015 (en)
dbp:reason
  • This sounds more like pre-spawning than like a pool pattern. (en)
dbp:wikiPageUsesTemplate
dcterms:subject
rdf:type
rdfs:comment
  • في برمجة الحاسوب، يعد تجميع الخيوط (بالإنجليزية: thread pool)‏ أحد أنماط تصميم البرمجيات لتحقيق تزامن التشغيل في برنامج حاسوبي ما. (ar)
  • In computer programming, a thread pool is a software design pattern for achieving concurrency of execution in a computer program. Often also called a replicated workers or worker-crew model, a thread pool maintains multiple threads waiting for tasks to be allocated for concurrent execution by the supervising program. By maintaining a pool of threads, the model increases performance and avoids latency in execution due to frequent creation and destruction of threads for short-lived tasks. The number of available threads is tuned to the computing resources available to the program, such as a parallel task queue after completion of execution. (en)
  • Un thread pool in programmazione indica un gestore software di thread utilizzato per ottimizzare e semplificare l'utilizzo dei thread all'interno di un programma. (it)
  • Trådpool (från engelskans thread pool) är ett designmönster som består av ett antal trådar (m) som skapas för att utföra ett antal uppgifter samtidigt (n). Vanligtvis motsvarar m inte n; istället är antalet trådar inställt till de tillgängliga datorresurserna för att hantera uppgifterna parallellt (processorer, kärnor, minne) medan antalet uppgifter beror på problemet och kanske inte är känt i förväg. (sv)
  • 线程池(英語:thread pool):一种线程使用模式。线程过多会带来调度开销,进而影响缓存局部性和整体性能。而线程池维护着多个线程,等待着监督管理者分配可并发执行的任务。这避免了在处理短时间任务时创建与销毁线程的代价。线程池不仅能够保证内核的充分利用,还能防止过分调度。可用线程数量应该取决于可用的并发处理器、处理器内核、内存、网络sockets等的数量。 例如,对于计算密集型任务,线程数一般取cpu数量+2比较合适,线程数过多会导致额外的线程切换开销。 任务调度以执行线程的常见方法是使用同步队列,称作任务队列。池中的线程等待队列中的任务,并把执行完的任务放入完成队列中。 线程池模式一般分为两种:HS/HA半同步/半异步模式、L/F领导者与跟随者模式。 线程池的伸缩性对性能有较大的影响。 * 创建太多线程,将会浪费一定的资源,有些线程未被充分使用。 * 銷毀太多執行緒,將導致之後浪費時間再次創建它們。 * 创建线程太慢,将会导致長時間的等待,性能變差。 * 銷毀執行緒太慢,导致其它執行緒资源饥饿。 (zh)
rdfs:label
  • تجميع الخيوط (أنماط تصميم البرمجيات) (ar)
  • Thread pool (it)
  • Thread pool (en)
  • Thread pool (pt)
  • Trådpool (sv)
  • 线程池 (zh)
owl:sameAs
prov:wasDerivedFrom
foaf:depiction
foaf:isPrimaryTopicOf
is dbo:wikiPageRedirects of
is dbo:wikiPageWikiLink of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License