[2.0] Why can't I perdorm an asynchronous tasks?
Hello you guys!!
I have a class, with a list in it, and a method to papulate that list.
I want to perform the population of the list in another thread.
to do this, I use this code:
Code:
MyClass NewClass = new MyClass();
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(NewClass.populateList));
t.Start();
But after this, the list is still empty...
what am I doing wrong?
thanks!!
:wave:
Re: [2.0] Why can't I perdorm an asynchronous tasks?
There's no possible way to know without seeing the code for the PopulateList method. Are you sure that you are populating the same object in the worker thread that you're later testing in the UI thread?
Re: [2.0] Why can't I perdorm an asynchronous tasks?
When I was not using the second thread, the code worked fine, and the list
was populated...
Re: [2.0] Why can't I perdorm an asynchronous tasks?
We are not telepathic. Your app does what the code tells it to do. Without the code we cannot possibly know what the issue is.
Re: [2.0] Why can't I perdorm an asynchronous tasks?
OK, I just wanted to know if I am using the second thread like I should...
The code to populate the list works, but the code to start the second thread
gives me nothing... it doesn't even step into the populateList method...