본문 바로가기
개발언어/C#

[C#] Thread 배열에 담아 다중 Thread 실행 해보기

by 창용이랑 2022. 9. 1.
728x90

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();

            }

 

 

출처: https://hwoarang757.tistory.com/entry/Thread-배열에-담아-다중-실행-해보기 [실패하면 일어서서 다시 전진 하면 된다!!!!!!!!!!!!!:티스토리]