Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Dispatcher thread and UI thread

Tags:

c#

wpf

dispatcher

Is UI thread and Dispatcher thread are same in WPF or is there any difference?

like image 450
Mohd Ahmed Avatar asked May 11 '13 05:05

Mohd Ahmed


People also ask

What is difference between UI thread and main thread?

Originally Answered: What is difference between UI thread and main thread in Android? UI thread is what render UI component/Views. Main thread is what which start the process/app. In Android UI thread is main thread.

What is the UI thread?

User Interface Thread or UI-Thread in Android is a Thread element responsible for updating the layout elements of the application implicitly or explicitly. This means, to update an element or change its attributes in the application layout ie the front-end of the application, one can make use of the UI-Thread.

Is UI thread main thread?

It is also almost always the thread in which your application interacts with components from the Android UI toolkit (components from the android. widget and android. view packages). As such, the main thread is also sometimes called the UI thread.

How many dispatchers are there in WPF?

A dispatcher is always associated with a thread and a thread can have at most one dispatcher running at the same time. A thread does not need to have a dispatcher. By default there is only one Dispatcher - For the UI.


1 Answers

A Dispatcher is responsible for managing the work for a thread.

The UI thread is the thread that renders the UI.

The UI thread queues work items inside an object called a Dispatcher. The Dispatcher selects work items on a priority basis and runs each one to completion. Every UI thread must have at least one Dispatcher, and each Dispatcher can execute work items in exactly one thread.

From this article. Read it for a more thorough description of the UI Rendering in WPF

like image 74
Emond Avatar answered Sep 19 '22 18:09

Emond