Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a CLR Worker Thread and a Worker Thread?

Tags:

Looking at the Concurrency Analyzer, Threads view it appears my application produces far, far more threads than I would have thought. Most of these are either a "CLR Worker Thread" or a "Worker Thread".

What are the differences? Under what circumstances are each created?

Clip of Concurrency Analyzer, Threads view

like image 740
pomeroy Avatar asked Nov 29 '11 21:11

pomeroy


People also ask

What is a CLR thread?

The CLR thread pool contains two kinds of threads—the worker threads and the I/O completion port or IOCP threads. That means your ASP.Net worker process actually contains two thread pools: the worker thread pool and the IOCP thread pool. Naturally, these pools have different purposes.

What is the difference between worker thread and normal thread?

People use the word "worker" when they mean a thread that does not own or interact with UI. Threads that do handle UI are called "UI" threads. Usually, your main (primary) thread will be the thread that owns and manages UI. And then you start one or more worker threads that do specific tasks.

What are IOCP threads?

These are worker threads are further divided logically into two types, one is worker threads which are used to process CPU-intensive logic i.e., it mostly used CPU to execute its logic like any calculations, etc.., and another is I/O threads, these threads are used to perform I/O requests or time-consuming requests ...

What are worker threads C#?

A “worker thread” is just a thread which runs to perform some background work on the order of his boss(we can call it “client” ) and update work result to the client.


1 Answers

Concurrency Visualizer is a pretty new but really cool! feature so there are a bit (I believe yet) of information regarding it, below what I've found in official information sources like MSDN:

  • Worker thread - A thread that was created by the application main thread (Main Thread entry in the table)
  • CLR Worker Thread - A worker thread that was created by the Common Language Runtime

Useful links:

  • Concurrency Visualizer
  • Channels (Threads View)
  • Parallel Development in Visual Studio blog
  • Using the Concurrency Visualizer to Understand and Optimize UI Responsiveness
like image 77
sll Avatar answered Oct 27 '22 09:10

sll