pthread2 pthread를 사용하여 이벤트를 받아 처리하는 thread 생성하기 이전에 pthread를 windows기반 visual studio에서 설정하는 것을 작성했다. 이번에는 이벤트를 별도의 thread로 처리 할 수 있도록 하는 부분을 작성했고, 해당 부분을 공유하고자 한다. pthread_t타입의 commandThreadHandle을 선언하고, 사용하기 위해 pthread_create()한다. 1. pthread_create pthread_create는 아래와 같이 구성되어 있으며 thread는 쓰레드 식별시 사용되는 식별자다. attr은 특성 지정용이며 기본일 경우 NULL을 사용한다. start_routine은 실행할 함수며, 네번째 인자인 arg는 넘겨준 매개변수이다. int pthread_create(pthread_t *thread, const pthread_at.. 2020. 5. 31. windows환경에서 visual studio에 pthread library 포함하기 pthread는 유닉스계 lib이다. 나의 경우에는 linux 환경에서 동작하는 application을 개발하기 위해 but, 주로 사용하는 컴퓨터의 경우 windows 이기 때문에 해당 library를 windows에서 사용 할 수 있도록 할 필요가 있었다. pthread는 찾아보니 대부분 아래 링크에서 library를 다운받아 사용하고 있다. https://www.sourceware.org/pthreads-win32/ POSIX Threads (pthreads) for Win32 Open SourcePOSIX Threads for Win32 Current release: 2.9.1 (2012-05-27)See the ANNOUNCEMENT and NEWS for details.Pthreads-w32 .. 2020. 5. 31. 이전 1 다음