티스토리 뷰
using System;
using System.Threading;
// Simple threading scenario: Start a static method running
// on a second thread.
public class ThreadExample {
// The ThreadProc method is called when the thread starts.
// It loops ten times, writing to the console and yielding
// the rest of its time slice each time, and then ends.
public static void ThreadProc() {
for (int i = 0; i < 10; i++) {
Console.WriteLine("ThreadProc: {0}", i);
// Yield the rest of the time slice.
Thread.Sleep(0);
}
}
public static void Main() {
Console.WriteLine("Main thread: Start a second thread.");
// The constructor for the Thread class requires a ThreadStart
// delegate that represents the method to be executed on the
// thread. C# simplifies the creation of this delegate.
Thread t = new Thread(new ThreadStart(ThreadProc));
// Start ThreadProc. Note that on a uniprocessor, the new
// thread does not get any processor time until the main thread
// is preempted or yields. Uncomment the Thread.Sleep that
// follows t.Start() to see the difference.
t.Start();
//Thread.Sleep(0);
for (int i = 0; i < 4; i++) {
Console.WriteLine("Main thread: Do some work.");
Thread.Sleep(0);
}
Console.WriteLine("Main thread: Call Join(), to wait until ThreadProc ends.");
t.Join();
Console.WriteLine("Main thread: ThreadProc.Join has returned. Press Enter to end program.");
Console.ReadLine();
}
}
- Total
- Today
- Yesterday
- .submit()
- java-개발 환경 설정하기
- In App Purchase
- 스프링 시큐리티(spring security)
- 람다식(lambda expression)
- jstl(java standard tag library)-core
- 제품 등록
- java.sql
- jstl(java standard tag library)
- 스프링 시큐리티(spring security)-http basic 인증
- docker
- 진수 변환
- 표현 언어(expression language)
- 스프링 프레임워크(spring framework)
- error-java
- await
- java web-mvc
- 인텔리제이(intellij)
- java 키워드 정리
- 메이븐(maven)
- MainActor
- 문자 자르기
- 스프링 프레임워크(spring framewordk)
- React
- nl2br
- REST API
- jsp 오픈 소스
- 특정 문자를 기준으로 자르기
- system.io
- System.Diagnostics
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |