Solved

Thread was being aborted for a background thread

Posted on 2013-01-16
3
510 Views
Last Modified: 2013-01-20
I am running a long process which imports a long csv list into database in a separate thread

threadStart = new ThreadStart(processCSVUsers);
            thread = new Thread(threadStart);
            thread.IsBackground = true;        
            thread.Start();


but I am facing one issue, if I run to many applications on this same pc then some times I am getting "Thread was being aborted." exception.

what I can do to make sure that this process always finsihs
0
Comment
Question by:yadavdep
[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 75

Accepted Solution

by:
käµfm³d   👽 earned 185 total points
ID: 38782315
Try removing:

thread.IsBackground = true;

Open in new window


http://msdn.microsoft.com/en-us/library/h339syd0.aspx
0
 

Author Comment

by:yadavdep
ID: 38782349
what if I set the thread priority to highest
0
 
LVL 8

Expert Comment

by:deepu chandran
ID: 38785990
Hi,

With in your processCSVUsers function , lock  your CSV read object and try

Refer below article
http://msdn.microsoft.com/en-us/library/c5kehkcz(v=vs.80).aspx

-- Deepu
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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