Solved

Thread was being aborted for a background thread

Posted on 2013-01-16
3
506 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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

791 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