2005년 6월 10일 금요일

Reentrent and thread safe

Reentrent function
- Static Data를 전혀 사용하지 않는 다.
  non-reentrent function을 call하지 않는 다.

thread safe fuction
- 다른 thread가 들어와도 안전하다.
  lock을 이용할 수도 있고, thread local storage를 이용할 수도 있다.

reentrent 이면 thread safe하다
Thread safe해도 reentrent하지 않을 수 있다.
interrupt 같은 상황은 single thread에서도 발생할 수 있기 때문이다.
signal handler에서는 reentrent function만 쓰는 것이 좋다.

댓글 없음:

댓글 쓰기