Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

Considering going multi-threaded

So far I have not written a multi-threaded application in C# but really need to do so.  I am wondering how significant this will be when it comes saving data in ArrayLists?  I have heard the term "thread safe lists" but do not know what this means.  Can more than one thread perform operations on a list at the same time?

How about if a thread should crash or lock up.  Can another thread restart that thread?  Does multi threading make a program more stable?

Curious.

Thanks,
newbieweb
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

I have a large code base and doubt it would be wise to jump into anything.  But since there is a GUI there's the obvious attraction that the user would never need to wait before interacting with the controls.

How do threads interact with each other?  Maybe I could get one thread for the GUI and another thread for the behind the scenes processes.
threads interact by sending each other signals in some way (maybe blocking each other or doing other things like raising events or even sending a message to the other thread). With a GUI yes it would make it more responsive but you also have to do alot of work with these types of threads as UI controls can only be touched from the main thread.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
simplifies but not when you are talking about a large app with many tasks.
Avatar of J1H1W1
J1H1W1

You are correct.  I should not have stated my own opinion, which only invited an equally inept opinion.  From the help files:
The BackgroundWorker class allows you to run an operation on a separate, dedicated thread. Time-consuming operations like downloads and database transactions can cause your user interface (UI) to seem as though it has stopped responding while they are running. When you want a responsive UI and you are faced with long delays associated with such operations, the BackgroundWorker class provides a convenient solution.