event_thread1 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. 이전 1 다음