Wednesday, May 18, 2005

How To Pass Parameters to Threads in Windows Forms Applications and Get Results

How To Pass Parameters to Threads in Windows Forms Applications and Get Results

"Launching new threads is easy, but it's not as obvious how you can pass parameters to the threads and get the results back. In addition, accessing Windows Forms controls from multiple threads can cause problems. In this article, you'll see how to pass parameters, receive results, and access controls safely from multiple threads in a Windows Forms application. ..."

I've tried to stay away from multi-threaded app development, not really needing them and not finding a true use case where they were worth the possible problems (yeah, I got bit by the Daniel Appleman's Multi-threading bug...). It's amazing what you can do with just raising a few events and so much easier than dealing with thread sync'ing/safety, etc, etc. "We don't need no stink'n multithreading..." ;)

But that's changing with some of the apps I'm now writing. I hope I can hold off till .Net 2.0, but we'll see...

Anyway this looks like a good article on the subject that I want to review in detail.

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...