Hi,
I'm new to libevent. I'm having some issues with my server program on
multi-processor machines. The same code seemed to work fine on a uniprocessor
machine. The machine is running FC8, kernel 2.6.23.1-42.
The errors I'm getting are:
[err] event_queue_remove: 0x9bcb0c4(fd 293) not on queue 8
and sometimes
event_process_active: Assertion `activeq != ((void *)0)' failed
The server consists of a main dispatch thread running evhttp and multiple
worker threads, each with their own instance of libevent.
The main dispatch thread gets an http request, sticks it onto a worker thread's
queue, and then writes a byte to the pipe of the worker thread to notify it.
The worker thread will respond to the http request.
Here's the skeleton of my program
main() {
httpd = evhttp_start("0.0.0.0", 8080);
evhttp_set_gencb(httpd, generic_handler, NULL);
event_dispatch();
evhttp_free(httpd);
}
generic_handler(evhttp_request *req, void *arg)
{
pick worker thread 'w'
stick request on worker thread queue
write(thread[w].send_fd, "", 1);
}
Each thread's initialization includes:
thread->base = event_init();
event_set(thread->event, thread->receive_fd, EV_READ | EV_PERSIST,
libevent_process, thread);
event_base_set(thread->base, thread->event);
event_add(thread->event, 0);
libevent_process(int fd, short which, void *arg)
{
if (read(fd, buf, 1) != 1) error;
if item on queue, respond then free item
}
Could you let me know which assumptions I'm violating here?
Thanks,
- Jad
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users