0

I have code for Database which is about of 4000 lines. It takes around 30 40 min. for executing.

I want to create 20 batch files containing equal lines of command so that I can start them at same time using thread.

None of the batch files are dependent on other. All are independent. Only dependency is all will execute on same database.

Can anyone please guide me how should I proceed so that the time it normally takes to execute is reduced.

2
  • What would each of the 20 batch files do? If they access the same tables and potentially lock them while doing the work, running them as seperate threads won't give you much performance gain. Commented Apr 15, 2010 at 12:48
  • Each batch file will execute separate table Commented Feb 15, 2013 at 23:49

1 Answer 1

1

1) running a series of commands in parallel will not always be faster.

2) to run them in parallel, you don't need batch files. Take a look at Threads or the ThreadPool.

3) To use batch files, write the contents to a (temp) file and execute it using the System.Diagnostics.Process class.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.