[Ilugc] different network I/O handling methods
- From: benignbala@xxxxxxxxx (Balachandran Sivakumar)
- Date: Sat, 31 Mar 2012 22:49:42 +0530
Hi,
On Sat, Mar 31, 2012 at 8:24 PM, Girish Venkatachalam
<girishvenkatachalam at gmail.com> wrote:
3) event based I/O loop handling
You should read the paper by Ousterhout, the author of Tcl about why
threading is a bad idea and event loops are better.
This is something that is easy to get wrong. I still see a lot
of people argue that multi-threaded is the way to go. But event based
approaches are a lot better. Also, I guess beyond a limit,
multi-threaded approach doesn't scale.
You could also use poll(2). Nowadays I just use poll.It is better than select.
You also have many methods to monitor file I/O. FreeBSD uses kqueue(2) and
?Linux has inotify and friends.
All UNICes have event(3) library which is a generic library for
network and file I/O
?using the event loop model.
In GNU/Linux, we now have epoll(7). Epoll is an event based I/O
notification based library. scales better normally, but can be a
little tricky if we are not used to event loops/event based
programming. Thanks
--
Thank you
Balachandran Sivakumar
Arise Awake and stop not till the goal is reached.
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- Swami Vivekananda
Mail: benignbala at gmail.com
Blog:
http://benignbala.wordpress.com/
Other related posts: