|
-
Nov 23rd, 2006, 01:51 PM
#1
Thread Starter
Fanatic Member
[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!!
-
Nov 23rd, 2006, 04:47 PM
#2
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?
-
Nov 23rd, 2006, 05:58 PM
#3
Thread Starter
Fanatic Member
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...
-
Nov 23rd, 2006, 06:40 PM
#4
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.
-
Nov 24th, 2006, 04:41 AM
#5
Thread Starter
Fanatic Member
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|