Presentation is loading. Please wait.

Presentation is loading. Please wait.

Thread pool based Web server 조태문. Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 2 개발 계획 1/3 필수 요구사항 –“Get” method.

Similar presentations


Presentation on theme: "Thread pool based Web server 조태문. Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 2 개발 계획 1/3 필수 요구사항 –“Get” method."— Presentation transcript:

1 Thread pool based Web server 조태문

2 Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 2 개발 계획 1/3 필수 요구사항 –“Get” method 에 대한 응답을 처리할 수 있어야 함. –thread pool mechanism –Boss & worker model – 각 쓰레드간 자원 공유는 전역 변수 ( 구조체 ) 를 통함. – 용도 및 목적에 따른 구조화 프로그래밍 source 분할 header 는 통합 –memory leakage 및 기타 서비스에 큰 영향이 없어야함. – 쓰레드간 동기화는 mutex 사용 –Busy wait 없음 : signal 사용. ( 조건변수로 변경 ) –daemon 화로 서비스에 등록 가능한 상태 ( 테스트 못함 )

3 Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 3 개발 계획 2/3 부가 개발계획 – 확장성 : cgi, POST 등 ( 적용되어 있지 않음. ) –logging thread 사용 ( 적용되어 있지 않음. ) –Real time mechanism 적용. ( 필요없음. )

4 Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 4 개발 계획 3/3 개발기간 –2009/01/19 ~ 2009/02/9 시험목록 – 안정 – 성능

5 Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 5 Server over view Start run loop = 1 Server initailize SIG_INT signal? loop = 0 loop? Server destroy End loop == 1 loop == 0 accept Client socket queue (Shared) mutex_locking push mutex_unlocking HTTP processing in Worker thread Main thread mutex_locking pop mutex_unlocking Send HTML to client

6 Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 6 initializing scenario Start Create listen socket SO_REUSEADDR SIG_INT wait Create clinet scoket queue Init socket queue Init thread pool Create worker thread Init work thread info thread detach Init main(accept loop) thread thread detach All threads check worker thread suspend

7 Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 7 Boss & Worker & Shared queue accept Client socket queue (Shared) mutex_locking push mutex_unlocking client request Connect() Search Idle woker thread pthread_cond_wait thread info = BUSY request read ( timeout 10 sec) HTTP parsing HTML read send HTML to client( timeout 10 sec ) thread info = IDLE Worker thread init mutex_locking pop mutex_unlocking loop? Worker thread exit pthread_cond_signal going active pop fail going suspend pop success loop == 1 loop == 0 mutex_locking pop mutex_unlocking loop? loop == 1 Main thread exit loop == 0


Download ppt "Thread pool based Web server 조태문. Copyright © 2005 Thin Multimedia, Inc. All Rights Reserved. thin multimedia inc. » 2 개발 계획 1/3 필수 요구사항 –“Get” method."

Similar presentations


Ads by Google