... | ... | @@ -339,7 +339,7 @@ thread가 생성되면 오랜 시간동안 생성돼 있는 유형. |
|
|
**5. CLR thread pool**
|
|
|
**System.Threading.ThreadPool :** thread pool은 background task를 수행하는 thread의 집합이다. 필요할 때마다 thread를 꺼내 쓰고 필요없어지면 다시 pool에 thread가 반환된다.
|
|
|
<br>
|
|
|
**6. System.Threading.EventWaitHandel**
|
|
|
**6. System.Threading.EventWaitHandle**
|
|
|
thread로 하여금 이벤트를 기다리게 만들 수 있고, 다른 thread에서 원하는 이벤트를 발생시키는 시나리오에 적합하다. EventWaitHandel 객체를 응용하면 ThreadPool의 단점을 보완할 수 있다. EventWaitHandle.Set method를호출해 Signal 상태로 전환된 이벤트가 Non-Signal 상태로 자동으로 전환되느냐에 따라 ManualResetEvent, AutoResetEvent로 나뉜다. ManualResetEvent는 여러 개의 thread가 동시에 여러 개의 작업을 처리할 때 유용하다.
|
|
|
|
|
|
``` cs
|
... | ... | |