I am working on a WPF application and I am running into freezing issues, by now I have learned that its a single threaded application, but i am getting confused with terminologies
I simple terms
Difference between Async/Await and Dispatcher
I want to explain my point of view so its clear on both ends my misunderstanding , until now I have learned that most applications are STA (in c#), and you have to use asynchronous programming, which can very well involve
- A single thread that shifts work on the UI thread by prioritizing work that has already completed and then using a worker thread to notify the UI thread that the heavy work is done
- Also a truly multi threaded application where a thread needs to be created to complete the task on it
I think for most part my concept is at least solid to say the least where I lack is applying these abilities
for instance i though that previously to enable asynchronous programming we had to use delegates to be called from the main method, which evolved into a dispatcher cutting of delegates which further evolved into async and await cutting 'ANY SINGLE USE OF' dispatcher (even that literal keyword)
so all i used were "async" word at the declaration of the function, followed by the "task", then awaiting some intense process by sticking an "await" word before it finally encapsulating that intense work with Task.Run(() => IntenseWork())
but now I am confused that you have to use Dispatcher word because UI elements can only be accessed by dispatcher , and use Dispatcher.Invoke(IntenseWork()), then there is Dispatcher.Begininvoke and Dispatcher.AsyncIncoke
DOUBT:
in which case async/await and task.run isn't going to be enough and is task parallel library even going to be used here
I asked questions and reserched and am stuck at these conclusions, these r my previous questions
Using async and await to achieve asynchronicity in example problem