A
A
Alexander2012-11-09 13:01:10
linux
Alexander, 2012-11-09 13:01:10

linux. Non-blocking server. What type is better to use?

In Linux, a server on a non-blocking connection can be created in three ways, through:
- select
- poll
- epoll
what is better to use, the advantages and disadvantages of each type.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
NiGHt_LEshiY, 2012-11-09
@NiGHt_LEshiY

If there are a lot of open connections (n), then poll and epoll. If there are fewer active connections (k), then epoll will be better. It will "look through" the list of descriptors in O(k), and poll in O(n).
Related:
stackoverflow.com/questions/5383959
stackoverflow.com/questions/4039832

I
Indexator, 2012-11-09
@Indexator

You should probably pay attention to the course of lectures Network programming in UNIX , which

prepared by SkyDNS and Aideko specialists

more specifically, a lecture on how to solve the problem of 10,000 connections? , where
Course author Alexander Patrakov explains which functions can be called instead of select() so that a program rewritten using them can efficiently handle a large number of simultaneous connections.
The practical task was to rewrite the astrological server using the epoll() family of functions and check if it can withstand 10,000 connections.

R
Ramires, 2012-11-09
@Ramires

Interesting article on poll/select/much more

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question