comparison src/event/modules/ngx_aio_module.c @ 1020:c95800738d2c

axe aio drafts
author Igor Sysoev <igor@sysoev.ru>
date Thu, 11 Jan 2007 22:08:50 +0000
parents 9c2f3ed7a247
children f69d1aab6a0f
comparison
equal deleted inserted replaced
1019:447051f68623 1020:c95800738d2c
164 { 164 {
165 return ngx_kqueue_module_ctx.actions.process_events(cycle, timer, flags); 165 return ngx_kqueue_module_ctx.actions.process_events(cycle, timer, flags);
166 } 166 }
167 167
168 #endif /* NGX_HAVE_KQUEUE */ 168 #endif /* NGX_HAVE_KQUEUE */
169
170
171 #if 0
172
173 /* 1 */
174 int ngx_posix_aio_process_events(ngx_log_t *log)
175 {
176 listen via SIGIO;
177 aio_* via SIGxxx;
178
179 sigsuspend()/sigwaitinfo()/sigtimedwait();
180 }
181
182 /* 2 */
183 int ngx_posix_aio_process_events(ngx_log_t *log)
184 {
185 unmask signal
186
187 listen via SIGIO;
188
189 /* BUG: SIGIO can be delivered before aio_*() */
190
191 aio_suspend()/aiowait()/aio_waitcomplete() with timeout
192
193 mask signal
194
195 if (ngx_socket_errno == NGX_EINTR)
196 look listen
197 select()/accept() nb listen sockets
198 else
199 aio
200 }
201
202 /* 3 */
203 int ngx_posix_aio_process_events(ngx_log_t *log)
204 {
205 #if 0
206 unmask signal
207
208 /* BUG: AIO signal can be delivered before select() */
209
210 select(listen);
211
212 mask signal
213 #endif
214
215 pselect(listen, mask);
216
217 if (ngx_socket_errno == NGX_EINTR)
218 look ready array
219 }
220
221 void aio_sig_handler(int signo, siginfo_t *siginfo, void *context)
222 {
223 push siginfo->si_value.sival_ptr
224 }
225
226 #endif