I have a tcp server which uses libev as an event loop; for new accepted sockets i set:
ev_io_init(&conn->io, tcp_conn_on_event_cb, conn->fd, EV_READ | EV_WRITE);
when a new connection is comming, my server consumes whole the CPU cycles, i have 100% CPU usage. my program calls all the time the callback tcp_conn_on_event_cb with revents set as EV_WRITE
static void tcp_conn_on_event_cb(ev_loop_t *loop, ev_io *ev, int revents)
when i make
strace mybinary
i've this:
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
epoll_wait(4, {{EPOLLOUT, {u32=7, u64=4294967303}}}, 64, 59743) = 1
....
is there a solution fo this problem please?