KAIST

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ KAIST ] in KIDS
글 쓴 이(By): ttagai (겨울나그네)
날 짜 (Date): 2002년 4월  9일 화요일 오후 04시 35분 48초
제 목(Title): [q] pthread_atfork() 에 대해 알려주세요



pthread_atfork() 의 사용법이나 특징을 아시는 분은 글좀 올려주세요..

man page  를 봐도 잘 이해가 되지 않는군요...

이것을 찾게 된이유는, MT 환경에서는 fork() system call 이 dead lock 을 유발할수 있다고 
있다고 해서 찾게 되었습니다..

그럼 미리 감사드립니다...

<PS> 아래는 제 시스템의 man fork 입니다...
  fork() Safety
     If a Solaris threads application calls fork1()  or  a  POSIX
     threads  application  calls  fork(), and the child does more
     than simply call exec(), there is a possibility of  deadlock
     occurring   in   the  child.   The  application  should  use
     pthread_atfork(3THR) to ensure safety with respect  to  this
     deadlock.   A  Solaris  threads  application must explicitly
     link with -lpthread to access pthread_atfork(). Should there
     be  any  outstanding  mutexes  throughout  the  process, the
     application should call pthread_atfork()  to  wait  for  and
     acquire  those  mutexes  prior to calling fork() or fork1().
     See  "MT-Level of Libraries"  on  the  attributes(5)  manual
     page.

[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.