[fpc-devel] Linux Signals
Michael Van Canneyt
michael at freepascal.org
Sun Jan 2 16:07:38 CET 2011
On Sun, 2 Jan 2011, Andrew Brunner wrote:
> On Sun, Jan 2, 2011 at 4:43 AM, Michael Van Canneyt
> <michael at freepascal.org> wrote:
>> Do note that you're back to polling, which I understood you wanted to avoid
>> in the first place ?
> Sigh - yes, your right. I haven't given up on kernel level signals
> (SIGIO/SIGPOLL) and random posts on various *nix forums talk about
> people doing things as I suspect. So I realize that socket signaling
> is possible. There are only two io events I need. I am willing to
> use epoll_* to run some tests. If the kernel is efficient at circling
> the array - I may not notice the difference. People have mentioned
> that epoll is scalable within reasonable expectations of using my
> engine. 3,000 sockets per thread shouldn't be too much to handle.
Indeed, I really didn't see why the polling would be such a problem for you.
It's just the unix/posix way of doing things.
On windows, events pervade the system from A to Z, so I can believe that
it's more efficient on that platform. But trying to transplant Windows-isms
on Unix is simply a bad idea, doomed to fail.
All webservers I know use polling on unix, and they are what you might
call 'high availablility' environments.
If your design is good, it should not be too much of a problem to separate
the IO from the rest of your handling, and then all the rest of your code
need not know whether it is polling or messaging that's being used.
More information about the fpc-devel