티스토리 뷰
아래 예제는 Thread를 간단하게 시작하는 방법을 사용한 것이다.
단 한줄로 Thread를 시작한다.
using System;
using System.Threading;
namespace ThreadTest
{
class Program
{
static void Main(string[] args)
{
new Thread(Go).Start(); // Call Go() on a new thread
Go(); // Call Go() on the main thread
}
static void Go()
{
for (int i = 0; i < 5; i++)
Console.WriteLine(i);
}
}
}
아래는 실행 결과 화면이다.
단 한줄로 Thread를 시작한다.
using System;
using System.Threading;
namespace ThreadTest
{
class Program
{
static void Main(string[] args)
{
new Thread(Go).Start(); // Call Go() on a new thread
Go(); // Call Go() on the main thread
}
static void Go()
{
for (int i = 0; i < 5; i++)
Console.WriteLine(i);
}
}
}
아래는 실행 결과 화면이다.
'Code > C#' 카테고리의 다른 글
static field를 사용한 Thread (0) | 2007.12.09 |
---|---|
Thread에서 공동의 인스턴스 사용 예제 (0) | 2007.12.09 |
Thread Join 사용법과 예제 (0) | 2007.12.08 |
Thread Abort 사용법과 예제 (0) | 2007.12.08 |
Thread & Lock 사용법과 예제 (0) | 2007.12.08 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Automation
- WinAutomation
- registry
- tagREADYSTATE
- AxWebBrowser
- iTextSharp
- Phalanger
- 스크린캡쳐
- Microsoft
- Sample Code
- AdSense감추기
- 유틸리티
- c#
- ScreenHunter
- 애드센스숨기기
- READYSTATE_COMPLETE
- DotNetMagic
- jre
- .net framework
- Regular Expressions
- windows
- java
- autohotkey
- iText
- Service pack
- Rollback Rx
- 애드센스감추기
- download.com
- AdSense숨기기
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
글 보관함