This blog serves as a dumping ground for my own interests. On it you will find anything which I want to keep track of; links, articles, tips and tricks. Mostly it focuses on C++, Javascript and HTML, linux and performance.
Saturday, 12 November 2011
io
epoll
eventfd for inter-thread comms
epollfd for socked comms
#include <sys/epoll.h>
int epoll_create (int size)
A successful call to epoll_create() instantiates a new epoll context, and returns a file descriptor associated with the instance.
The size parameter is a hint to the kernel about the number of file descriptors that are going to be monitored; it is not the maximum number. Passing in a good approximation will result in better performance
once done, release the resources with close(fd)
int epoll_ctl (int epfd, int op,
int fd,
struct epoll_event *event);
epoll_ctl() system call can be used to add file descriptors to and remove file descriptors from a given epoll context
struct epoll_event
{
__u32 events; /* events */
union
{
void *ptr;
int fd;
__u32 u32;
__u64 u64;
} data;
};
https://www.kernel.org/doc/man-pages/online/pages/man2/eventfd.2.html
http://stackoverflow.com/search?q=epoll
http://linux.derkeiler.com/Mailing-Lists/Kernel/2006-03/msg00084.html
http://linux.die.net/man/2/epoll_ctl
http://en.wikipedia.org/wiki/Epoll
http://www.kegel.com/c10k.html
http://bulk.fefe.de/scalability/
http://pl.atyp.us/content/tech/servers.html
http://www.citi.umich.edu/projects/linux-scalability/reports/accept.html
http://www.devshed.com/c/a/BrainDump/Linux-Files-and-the-Event-Poll-Interface/
Labels:
c++,
cpp,
linux,
programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment