static field는 모든 Thread에서 공동으로 사용된다. 아래 예제를 살펴보자. using System; using System.Threading; namespace ThreadTest { class Program { // Static fields are shared between all threads static int count; static void Main(string[] args) { new Thread(Go).Start(); Go(); } static void Go() { for (int i = 0; i < 5; i++) { count++; Console.WriteLine(count); } } } } 위의 예제에서 count는 static field이다. 두개의 thread가 coun..
아래는 두개의 Thread가 공동의 instance를 사용한 예제이다. Foo 클래스 인스턴스인 foo를 공동으로 사용한 두개의 thread가 실행되었다. using System; using System.Threading; namespace ThreadTest { class Program { static void Main(string[] args) { Foo foo = new Foo(); new Thread(foo.Go).Start(); foo.Go(); } } class Foo { private int count = 0; public void Go() { for (int i = 0; i < 5; i++) { count++; Console.WriteLine(count); } } } } 실행 결과 화면은 ..
아래 예제는 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); } } } 아래는 실행 결과 화면이다.
- Total
- Today
- Yesterday
- 유틸리티
- iTextSharp
- AdSense감추기
- 애드센스감추기
- AxWebBrowser
- iText
- ScreenHunter
- windows
- registry
- Sample Code
- Automation
- DotNetMagic
- download.com
- READYSTATE_COMPLETE
- Regular Expressions
- Phalanger
- autohotkey
- AdSense숨기기
- Rollback Rx
- java
- Microsoft
- .net framework
- Service pack
- tagREADYSTATE
- 애드센스숨기기
- c#
- WinAutomation
- 스크린캡쳐
- jre
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |