멀티 스레드에서 open() 함수가 non safe가 맞는거죠?

jms_jms의 이미지

man 페이지에서 확인되는 바로는 open함수가 non-safe라고 나오고 있는데...

하나의 전역 FD를 공유하는게 아니고...

파일에 접근할때마다 open(), read(), write() close()를 하고 있는데...

크게 문제가 발생되는 부분은 딱히 없어서요...

하지만 스레드 스위칭이 I/O 연산이 일어날때 발생될 수도 있을 것 같은데...

non-safe가 맞는거죠?

자세히 설명해주세요..ㅠ,ㅠ

감사합니다.

jick의 이미지

thread-safe한 것으로 알고 있습니다만...

http://stackoverflow.com/questions/5451972/is-open-thread-safe
It depends on the operating system and C run time library. If it is POSIX.1-2001 or POSIX.1-2008 compliant then it must be thread safe ...

jms_jms의 이미지

그렇군요... 답변 감사합니다.

The ***er you become, the more you are able to ***.