|
-
May 12th, 2015, 10:14 AM
#2
Re: Multithreaded class
Rather than using raw threads, I think you would benefit greatly from taking a bit of time looking at Tasks. Tasks are lighter weight than threads, though a bit different. They are a relatively recent addition to the language, but I think that you would find them quite useful for what you are trying to do.
What you are doing doesn't look so wrong to me. There is no point in passing in an argument to task_mapoutDirectories, because the argument you are passing in is located at class scope, so it is accessible by the thread as well as the UI thread, and that seems fine. I would guess that is where your problem is coming from, though you didn't state why the code wasn't working. Still, I suspect that you'd find an easier solution using Tasks...once you get past the relatively minor learning curve.
My usual boring signature: Nothing
 
Tags for this Thread
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
|