.net - Creating controls in a non-UI thread -


I have a plug-in model in which various complex user controls are stored in DLL and load on run time Use of Instituted

  Activator. Create InstanceForm (DLPPit, ClassName).  

Since I'm loading a lot of these so I wanted to do it in the background, keeping my UI responsiveness by creating a new thread for loading. Control is done primarily and is shown when necessary.

It works fine - unless I try to establish an asset on one of the nested controls on one of these user controls, e.g. In the event handler of a button, which throws a cross threading exception, I realize that every time I use a property, I can check the incognito, but I do not have to worry about that , When users write code for control (especially because others do not always miss these bits of code).

So my question is, am I trying to, or how best to go about loading these controls in the background, I or it is basically impossible and do I have to control Sticking to the main thread?

I hope that the information I have given is enough to make my situation clear; If not, I would be happy to expand and provide code samples.

To fix DLL is OK and create control objects in the background, but in the main thread, Including and including all user interaction, any programmatic changes of control properties (after it has been made) should be in the main thread. There is no way around this, as you probably already know that till those loads of DLLs and control creation do not come in the era, I have no reason to do this in different background threads.

If some actions executed by the control are blocking the UI and you want them to be in the background, this is a different story, and you better observe each action on individual actions and communicate Make clear ways to create between UI threads and background threads.

Trying to do a normal one-fit-all framework that works in UI thread mode and in background mode and only checks for invokeRequired results anytime in worse Performance (as all threads are blocked in the inoc) or even (unlikened) deadlock as the application reaches a reasonable complexity, with each installation being considered separately, all updates in BeginInvoke Do async also Yes, the stability of the data can be the result of problems, (i.e. control at the time due to the invoice order behind the threads).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -