[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

When should I use thread?

Posted on 2011-03-24
3
Medium Priority
?
342 Views
Last Modified: 2012-05-11
I am learning to create thread but still it is not clear to me where to use them and where not or when or when not.

could you give me examples with applications.

Thank you.
0
Comment
Question by:iscivanomar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
nmarun earned 500 total points
ID: 35208644
0
 
LVL 7

Assisted Solution

by:jdavistx
jdavistx earned 500 total points
ID: 35209708
Generally speaking, you want to create another thread when you need to perform a computationally expensive task, but you want to keep doing other things while that task is running.  You don't want your user to have to wait for a 10 second task to complete, when you could be letting them do something else.

.NET gives us the BackgroundWorker to perform these expensive tasks for us, and lets us continue doing other things in the application.
http://msdn.microsoft.com/en-us/library/8xs8549b.aspx

Perhaps you're doing a lot of slow file I/O, but you want to update the GUI of your application to inform the user of the current operation, file, and estimated time it's going to take, you can use a BackgroundWorker to perform these file I/O tasks and using the functionality of the BackgroundWorker you can report back status to your GUI.
0
 

Author Closing Comment

by:iscivanomar
ID: 35210756
Thank you both.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question