#1 2017-03-07 01:56:56

Leslie7
Member
Registered: 2015-06-25
Posts: 248

Epoll under linux

AB,

The latest commits show  that epoll is coming to the mORMot - very exciting!
I assume this will effect the websocket connections  as well at some point ...

You are probably already  aware of this WSAPoll issue, but just in case:

https://curl.haxx.se/mail/lib-2012-10/0038.html

Offline

#2 2017-03-07 06:34:41

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Epoll under linux

@Leslie7,

The excitement is coming from the expected performance improvement, right?


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2017-03-07 07:07:08

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Epoll under linux

Yes, I know the WSAPoll issue, but what is planned is that this issue is not a big issue: AFAIR it appears only if the socket is broken before added to the poll, which is easy to circumvent.

The hardest part was to abstract all polling techniques: select, poll, epoll, depending on the system it runs on.
In short, we have designed an abstract class as a wrapper around epoll, then emulate it using select or poll.
Select is broken under POSIX (only up to 1024 file descriptors are possible), and WSAPoll is not available before Vista - here why we also implemented select... but with very poor performance, for sure.
It results in something like a KISS pure-pascal libevent/libev/libuv cross-platform set of classes.

Now I'm implementing:
- buffer-based polled reads, able to maintain a lot of connections with minimal resource overhead (to be used for frame-based protocols, like WebSockets or most IoT communication);
- class-based polled reads, to follow more complex HTTP format.

Offline

#4 2017-05-19 00:53:17

profh
Member
Registered: 2010-07-02
Posts: 161

Re: Epoll under linux

Offline

#5 2017-05-20 13:04:07

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: Epoll under linux

Scalable HTTP/S and TCP client sockets for the cloud
https://github.com/grijjy/DelphiScalableClientSockets

Offline

#6 2021-05-11 10:58:20

edwinsn
Member
Registered: 2010-07-02
Posts: 1,218

Re: Epoll under linux


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#7 2021-05-11 15:20:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: Epoll under linux

We already have something similar to libuv in mORMot, in pure pascal.

Offline

Board footer

Powered by FluxBB