for(int i=0; i<5; i++)<br />
{
Thread th = new Thread(threadMethod);
th.start();
}
Console.WriteLine("Thread Terminated");
ÀÌ·±½ÄÀ¸·Î ÇÁ·Î±×·¥À» ®´Âµ¥, Á¦ ¿¹»ó °á°ú´Â Thread¸¦ ÀÌ¿ëÇÏ¿©
ThreadMethod¸¦ 5¹ø È£Ãâ ÈÄ Console¿¡ "Thread Terminated"¸¦ Âï´Â °ÍÀ̾ú½À´Ï´Ù.
ÇÏÁö¸¸, Thread¸¦ ½ÇÇà½ÃÄѳõ°í "Thread Terminated"°¡ ¸ÕÀú ÄܼÖâ¿¡ Ãâ·ÂµÇ°í
±× µÚ·Î Thread°¡ ¿Ï·áµÇ¸é¼ threadMethod°¡ ½ÇÇà¿Ï·á µÇ´Â °ÍÀÔ´Ï´Ù.
óÀ½¿¡ Á¦°¡ °èȹÇß´øµ¥·Î ÇÁ·Î±×·¡¹ÖÇÏ·Á¸é ¾î¶»°ÔÇØÁÖ¾î¾ßÇÒÁö µµ¿ò ºÎŹµå¸³´Ï´Ù....
½Ì±Û½º·¹µå·Î Â¥´Ù°¡ ¸ÖƼ½º·¹µå°¡ ÇÊ¿äÇؼ ÇÏ·Á´Â µ¥ Àß¾ÈµÇ³×¿ä ¤Ì¤Ì | |
|
thread¸íÀ» ÁöÁ¤¾ÈÇÏ°í È£ÃâÇ߾ °¢°¢ÀÇ id°¡ ´Ù¸¦ÅÙµ¥ ±×°É ´Ù·ï¼ ó¸®Çϱ⵵ ½±Áö¾Ê±¸¿ä ¤Ì
À½ ±×·±µ¥ thread¿¡¼ ¶Ç ´Ù¸¥ thread¸¦ È£ÃâÇÏ´Â ±¸Á¶´Â ¾Æ´Õ´Ï´Ù..
Áú¹®±Û¿¡ ´Ù Æ÷ÇÔÀ» ¸ø½ÃÄѼ¿ä...
for¹®¿¡¼ thread¸¦ startÇÏ´Â °Í ¹Ø¿¡ joinÀ» °É¾îÁÖ¸é µÈ´Ù´Â°É·Î ÀÌÇØÇߴµ¥
±×·¸°ÔÇÏ´Â°Ô ¸Â´Â°ÇÁö¿ä??