쓰레드 폴링에 대해서 가르쳐주세요..
글쓴이: hellowee / 작성시간: 목, 2003/07/10 - 12:36오후
pthread_mutex_lock(&mutex);
pthread_cond_wait(&cond, &mutex);
clientsocket=g_socket;
pthread_mutex_unlock(&mutex);
g_socket = 접속한 소켓;
pthread_cond_signal(&cond);
여기서 클라이언트가 동시에 접속을 하면 mutex에서 시스템적으로 큐에 넣고 mutex를 락이 풀리면 그때 다시 처리 하지 않나요?
이상하게 동시에 접속하면 pthread_cond_wait가 안풀리네요?
Forums:
댓글 달기