Hi guys,

I have spend little time having a look at the performance problem with kqueue but I have build a patch that improves the situation. It's still not as fast as poll but it's near.

I would appreciate if you guys can give it a try and provide me with some feedback (mainly that it still works right ;-) ).

I don't have access to any PPC hardware so I couldn't have a look at the problems that you are having about the bad file descriptors.

Thanks and best regards,
Rodrigo
--- cherokee-0.4.28.old/cherokee/fdpoll-kqueue.c	2005-09-19 17:44:20.000000000 +0100
+++ cherokee-0.4.28/cherokee/fdpoll-kqueue.c	2005-10-28 17:26:30.000000000 +0100
@@ -224,47 +224,6 @@
 static void
 _set_mode (cherokee_fdpoll_kqueue_t *fdp, int fd, int rw)
 {
-
- 	if ( ( rw && (fdp->fdevents[fd] == KQUEUE_READ_EVENT ) ) ||
- 	     ( (!rw) && (fdp->fdevents[fd] == KQUEUE_WRITE_EVENT) ) ) {
-		/* If transitioning from r -> w or from w -> r 
-		 * clear any active event on the fd as we are
-		 * no longer interested on it.
-		 */
-		int n_events;
-		struct kevent changelist[1];
-		struct timespec timeout;
-		
-		memset(&changelist[0], 0, sizeof(struct kevent));
-		changelist[0].ident = fd;
-		if ( fdp->fdevents[fd] == KQUEUE_READ_EVENT ) {
-			changelist[0].filter = EVFILT_READ;
-		} else {
-			/* fdp->fdevents[fd] == KQUEUE_WRITE_EVENT
-			 */
-			changelist[0].filter = EVFILT_WRITE;
-		}
-		changelist[0].flags = EV_DELETE;
-
-		memset(&timeout, 0, sizeof(struct timespec));
-		/* Update the kqueue fd list without sleeping (zeroed timeout)
-		 */
-		n_events = kevent(fdp->kqueue,
-				  &changelist[0],
-				  1,
-				  NULL,
-				  0,
-				  &timeout);
-		/* Clear previous events if any
-		 */
-		fdp->fdevents[fd] = 0; 
-		if ( n_events < 0 ) {
-			PRINT_ERROR("ERROR: fd %d: kevent %s\n", fd, 
-				    strerror(errno));
-		}
-	}
-
-
 	_add_change( fdp, fd, rw, EV_ADD );
 }
 
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to