본문 바로가기
C# /WindowsForm

Thread 배열에 담아 다중 Thread 실행 해보기

by Hwoarang757 2013. 6. 19.

역시나 예제가 매우 허접스러워 죄송합니다... ㅡ.,ㅡ

 

Thread[] th = new Thread[3];

 

            for (int i = 0; i < th.Length; i++)

            {

                th[i] = new Thread(new ParameterizedThreadStart(RunScheDule));

            }

 

            foreach (Thread thread in th)

            {

                thread.Start("TABLENAME" + "|" + "SELECTQUERY");

            }

 

            foreach (Thread thread in th)

            {

                thread.Join();

            }