I need to bcp into Sybase servers different files into different tables
simultaneasly. Is the following architecture thread safe?
1st Have a Helper Class that will take as a parameter the bcpCmd so we
can pass as paremeter to the thread
It looks like this
public class WorkToBeDone
{
string bcpCmd;
public WorkToBeDone(string server)
{
this.bcpCmd = bcpCmd;
}
public void WorkDone()
{
//create a process to call the bcpCmd
}
}
//main thread
WorkToBeDone bcp1 = new WorkToBeDone("bcp1cmd");
Thread bcp1T = new Thread (new ThreadStart(bcp1.WorkDone));
bcp1T.IsBackground=false;
bcp1T.Start();
WorkToBeDone bcp1 = new WorkToBeDone("bcp2cmd");
Thread bcp2T = new Thread (new ThreadStart(bcp1.WorkDone));
bcp2T.IsBackground=false;
bcp2T.Start();
and so on...
//join them as the last step so all work can be completed
bcp1T.Join();
bcp2T.Join();
//get time start and end of bcp1 and bcp2 ojbjects
//send an e-mail about the work done
Thanks
*** Sent via Developersdex http://www.developersdex.com ***