yadavdep
asked on
Thread was being aborted for a background thread
I am running a long process which imports a long csv list into database in a separate thread
threadStart = new ThreadStart(processCSVUser s);
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
threadStart = new ThreadStart(processCSVUser
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER