Wrox Programmer Forums
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 11th, 2007, 04:53 PM
Authorized User
 
Join Date: Feb 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default threading

Is there a way to have a tread join my main thread for a certain amount of time, then have it go back to being separate? I need it to do this so that the worker thread can modify the main form safely.

There are 10 types of people - Those who understand binary, and those who don't.
__________________
There are 10 types of people - Those who understand binary, and those who don\'t.
http://bschleusner.googlepages.com/home
 
Old April 12th, 2007, 08:36 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I have had success using the BackgroundWorker component. It allows you to spin off some task to another thread, but it has events that are fired within the "parent" thread allowing thread safe updates to your user interface.

Here's an article explaining it further:

http://www.ondotnet.com/pub/a/dotnet...undworker.html

-Peter
 
Old April 12th, 2007, 08:40 AM
Authorized User
 
Join Date: Feb 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!

There are 10 types of people - Those who understand binary, and those who don't.
http://bschleusner.googlepages.com/home





Similar Threads
Thread Thread Starter Forum Replies Last Post
threading swifty_programmer ASP.NET 2.0 Basics 12 May 19th, 2007 06:10 AM
Multi-threading issue Bill Crawley Pro Visual Basic 2005 0 March 21st, 2007 06:19 AM
multi threading [email protected] BOOK: ASP.NET Website Programming Problem-Design-Solution 1 February 26th, 2007 11:48 PM
Threading kramis8 C# 1 April 27th, 2005 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.