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?


newbiewebSr. Software EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you have a locked up or crashed thread ... what it your current state? is it valid?

Generally you don't know the answers to these questions so you would have to terminate your application.

As for thread safe lists .. these can be done quite easily by using the Synchronized wrappers for the list and/or using manual syncrhonization for your accesses ...

Do you have any specific code that you are worried about making multi-threaded?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
newbiewebSr. Software EngineerAuthor Commented:
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.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

The background worker simplifies multi-threading.
simplifies but not when you are talking about a large app with many tasks.
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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.