Link to home
Start Free TrialLog in
Avatar of lep1
lep1

asked on

Instantiating Classes Via Threading

I implement a lot of different classes so that calculations in the New constructor of each class are carried out after instantiation using:

Dim run1 as New Compute(param1, param2, etc)

Open in new window

where Compute is a Class.

Question is, what is the appropriate way to instantiate a Class using threading?   I need to start piling up a lot of work in the classes by using threads, since the Windows GUI tends to hang as soon as processing with 3-4 running classes gets started.  

This also raises some very important questions.  (first, fyi - there is no GUI interaction with controls on Form1 when the classes are running -- so there would likely be no cross-threading issues).   At run-time, it was observed that if, say, 5 classes are instantiated, the processes got too heavy and the Windows 8 GUI tended to hang.   Given this, can I sequentially implement threads so that as one finishes, the next one starts?

Lastly, by now I would think that with VB.NET 2010, 2012 there is an improved method for limiting CPU usage for a thread.   This would prevent a users screen from freezing during heavy computations.   What is the best way to guard against GUI hangs for users (in case they have fewer/slower processor cores, less RAM, etc.)?
ASKER CERTIFIED SOLUTION
Avatar of Alex [***Alex140181***]
Alex [***Alex140181***]
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lep1
lep1

ASKER

Just links provided.  While ok for giving credit where credit is due, the responseis not very specific.