Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-01

Linux Signals

31 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner

I'm trying to get signals to work with sockets under x64 Ubuntu 10.10 (all updates)

I installed two handlers for two events SIGIO, and SIGHUP uising fpsigaction(SIGIO, @saAct, nil) . I was expecting to get a byte by byte signal under telnet to my server instance (110-pop3) on the IO but had only received the signal on CRLF. Firefox on the HTTP has the same problem but I suspect a problem since it is impossible to ever receive a signal for binary protocols having no CRLFs for as kernel triggers to signal applications. Perhaps this particular issue is better directed at Debian?

Another important thing is that (IMO) the data structure for TSigAction is out-dated.

Please refer to rtl/linux/signal.inc and compare the struct with the one specified at the URL I included for linux... The two structs are different.

http://www.kernel.org/doc/man-pages/online/pages/man2/sigaction.2.html

There are two issues.

Problem 1: How do I control the circumstances in which the signal is sent... To emulate conditions like windows... Which is every few seconds until the buffer is emptied for that socket descriptor. Problem 2: Info.FD =0. I did a trace into the callbacks and found that the socket handle was stored in the si_status field of the me, this seems problematic but I guess if it's
not attributed to the discrepency in the declaration of SigInfo, I'm looking for an approval to use this si_status as my socket number across linux distros - or is this just a Ubuntu fluke, and under say Red Hat I will receive my socket handle on the FD attribute !?!

The siginfo_t argument to sa_sigaction is a struct with the following (as interpreted by me)

  TSigVal = record
      case longint of
         0 : ( sival_int : longint );
         1 : ( sival_ptr : pointer );
  end;
  TSigInfo=record
    si_signo  : integer;     // Signal number */
    si_errno  : integer;     // An errno value */
    si_code   : integer;    // Signal code */
    si_trapno : integer;    // Trap number that caused
hardware-generated signal (unused on most architectures) */
    si_pid    : pid_t;        // Sending process ID */
    si_uid    : uid_t;        // Real user ID of sending process */
    si_status : integer;    // Exit value or signal */
    si_utime  : clock_t;    // User time consumed */
    si_stime  : clock_t;    // System time consumed */
    si_value  : TSigVal;   // Signal value */
    si_int    : integer;       // POSIX.1b signal */
    si_ptr    : pointer;       // POSIX.1b signal */
    si_overrun : integer;   // Timer overrun count; POSIX.1b timers */
    si_timerid :integer;     // Timer ID; POSIX.1b timers */
    si_addr    : pointer;    // Memory location which caused fault */
    si_band    : longInt;    // Band event (was int in glibc 2.3.2 and
earlier) */
    si_fd      : integer;      // File descriptor */
    si_addr_lsb:shortint;   // Least significant bit of address (since
kernel 2.6.32) */
  end;

I'm asking anyone with signals and socket experience to take a look at this. I can follow-up with a sample fp program if necessary...

Reply by email

Mark Morgan Lloyd
to Andrew Brunner
Andrew Brunner wrote 11 lines
I'm trying to get signals to work with sockets under x64 Ubuntu 10.10 (all updates) I installed two handlers for two events SIGIO, and SIGHUP uising fpsigaction(SIGIO, @saAct, nil) . I was expecting to get a byte by byte signal under telnet to my server instance (110-pop3) on the IO but had only received the signal on CRLF. Firefox on the HTTP has the same problem but I suspect a problem since it is impossible to ever receive a signal for binary protocols having no CRLFs for as kernel triggers to signal applications. Perhaps this particular issue is better directed at Debian?

I am neither a kernel hacker nor a network guru, but would a signal be raised when a byte was read or when a TCP packet- possibly comprising aggregated bytes- was transferred? I think you'd be better not using a standard telnet client for this but instead using Netcat (nc) or netpipes (faucet and hose) which will not, certainly by default, be fiddling with line-ends or aggregating bytes for efficiency.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marco van de Voort
to Andrew Brunner: I'm trying to get signals to work with sockets under x64 Ubuntu 10.10 (all updates) I…

In our previous episode, Andrew Brunner said:

Show quoted text 8 lines
Another important thing is that (IMO) the data structure for TSigAction is out-dated. Please refer to rtl/linux/signal.inc and compare the struct with the one specified at the URL I included for linux... The two structs are different. http://www.kernel.org/doc/man-pages/online/pages/man2/sigaction.2.html

IMHO it could be that that page is simply wrong, or dumbed down. It looks like a sigaction(3) page, while FPC implements a "true" sigaction(2).

Reply by email

Andrew Brunner
to Mark Morgan Lloyd: I am neither a kernel hacker nor a network guru, but would a signal be raised when a byte…
Mark Morgan Lloyd wrote 7 lines
I am neither a kernel hacker nor a network guru, but would a signal be raised when a byte was read or when a TCP packet- possibly comprising aggregated bytes- was transferred? I think you'd be better not using a standard telnet client for this but instead using Netcat (nc) or netpipes (faucet and hose) which will not, certainly by default, be fiddling with line-ends or aggregating bytes for efficiency.

Thanks for the hints. Yeah, I'm aware of pipelining with mail protocols and more recent WebSockets for streaming multiple datagrams. In context - I think your suggestion with a tool other than terminal would be welcomed and adopted ;-) Thanks again. Bottom line is - I am testing signal capabilities and nuances and nc looked promising but the same result. The packet was coalesced ending in CRLF with ./nc ... with or without -C for CRLF sending...

Which tells me there is going to be a SOCKET flag I need to set on the signal in association with this FD that says... Hey I'm a socket not a cmmand line session... or something to that effect.

Reply by email

Andrew Brunner
to Marco van de Voort: In our previous episode, Andrew Brunner said: IMHO it could be that that page is simply…
Marco van de Voort wrote 17 lines
In our previous episode, Andrew Brunner said: > Another important thing is that (IMO) the data structure for > TSigAction is out-dated. > Please refer to rtl/linux/signal.inc and compare the struct with the > one specified at the URL I included for linux...  The two structs are > different. > > http://www.kernel.org/doc/man-pages/online/pages/man2/sigaction.2.html IMHO it could be that that page is simply wrong, or dumbed down. It looks like a sigaction(3) page, while FPC implements a "true" sigaction(2). _______________________________________________ fpc-devel maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-devel

Excellent. Thanks. That means that the problem is elsewhere. I think I'm narrowing down the semantics. I'm down to the problem with setting the socket attribute to the signal as instead of a file. I read about it somewhere but I don't see the constant nearby in the header file for sigaction flags.

Reply by email

Nikolai Zhubr
to Andrew Brunner: I'm trying to get signals to work with sockets under x64 Ubuntu 10.10 (all updates) I…

01.01.2011 20:27, Andrew Brunner:

Show quoted text 11 lines
I'm trying to get signals to work with sockets under x64 Ubuntu 10.10 (all updates) I installed two handlers for two events SIGIO, and SIGHUP uising fpsigaction(SIGIO, @saAct, nil) . I was expecting to get a byte by byte signal under telnet to my server instance (110-pop3) on the IO but had only received the signal on CRLF. Firefox on the HTTP has the same problem but I suspect a problem since it is impossible to ever receive a signal for binary protocols having no CRLFs for as kernel triggers to signal applications. Perhaps this particular issue is better directed at Debian?

[...]

What are you trying to achieve ultimately? People tend to avoid using signals as much as possible nowadays (for anything beyond some nice handling of forced/fatal program termination and such) at least on linux. I'm not guru, just somewhat curious (because some time ago I had to re-engineer some small networking app, originating from windows, to be cross-platform and resource-friendly)

Nikolai

Reply by email

Marco van de Voort
to Nikolai Zhubr

In our previous episode, Nikolai Zhubr said:

Show quoted text 8 lines
[...] What are you trying to achieve ultimately? People tend to avoid using signals as much as possible nowadays (for anything beyond some nice handling of forced/fatal program termination and such) at least on linux. I'm not guru, just somewhat curious (because some time ago I had to re-engineer some small networking app, originating from windows, to be cross-platform and resource-friendly)

My guess is that he is desperately trying all straws to find something that matches the application model of his existing app, which is Windows centric.

Reply by email

Andrew Brunner
to Nikolai Zhubr: 01.01.2011 20:27, Andrew Brunner: [...] What are you trying to achieve ultimately? People…
Nikolai Zhubr wrote 6 lines
What are you trying to achieve ultimately? People tend to avoid using signals as much as possible nowadays (for anything beyond some nice handling of forced/fatal program termination and such) at least on linux. I'm not guru, just somewhat curious (because some time ago I had to re-engineer some small networking app, originating from windows, to be cross-platform and resource-friendly)

Hi Nikolai,

I'm trying to build a cross platform *event* driven socket signaling mechanism that does not employ polling algorithms. When you say resource-friendly... Do you mean CPU or memory? I'm looking for something to work as advertised in the Linux man pages for signals. If it turns out that signal information is missing via the Kernel - I have no qualms with submitting a few requests to the proper channels...

Reply by email

Andrew Brunner
to Marco van de Voort: In our previous episode, Nikolai Zhubr said: My guess is that he is desperately trying…
Marco van de Voort wrote
My guess is that he is desperately trying all straws to find something that matches the application model of his existing app, which is Windows centric.

I am exploring all options to switch to the most effective form for handling high scale (gargantuan) socket system management for at least 3 protocols across thousands of worker threads handling about 100 to 1000 socket ids per thread :-) All this confirmed to run flawlessly on Windows. You wanna sit here and tell me it can't / isn't to be done with LINUX!?!

Reply by email

Andrew Brunner
to Andrew Brunner: I am exploring all options to switch to the most effective form for handling high scale…
On Sat, Jan 1, 2011 at 5:45 PM, Marco van de Voort wrote: My guess is that he is desperately trying all straws to find something that matches the application model of his existing app, which is Windows centric.

Also, it should be pointed out, that the existing mechanism (which is commented out) in the app, is polling each socket in the manager's queue for data or connection status. This is highly in-efficient and cause unacceptable latencies across both Linux and Windows.

Reply by email

Marco van de Voort
to Andrew Brunner: I am exploring all options to switch to the most effective form for handling high scale…

In our previous episode, Andrew Brunner said:

on Windows. You wanna sit here and tell me it can't / isn't to be done with LINUX!?!

Aw, that got away to soon. Anyway, the question has come up before (recently even), and afaik nobody came up with anything but select(), and epoll(Linux)/kqueue (BSD+Mac) if that was not enough.

But *nix has no generalized handle system, so waiting on multiple event-types will always be a problem. There are some minor mitigating factors like that more handle types are files in *nix are files.

Reply by email

Nikolai Zhubr
to Andrew Brunner: I'm trying to build a cross platform *event* driven socket signaling mechanism that does…

02.01.2011 2:51, Andrew Brunner:

Hi Nikolai, I'm trying to build a cross platform *event* driven socket signaling

Ok, now its more clear :)

mechanism that does not employ polling algorithms.

Then use epoll (linux-specific invention, BSDs have kqueue instead).

There is no exact match between linux and win32 for any non-trivial sockets IO, but creating OOP abstractions helps mitigate this.

When you say

resource-friendly... Do you mean CPU or memory? I'm looking for

CPU was the biggest concern in our case.

something to work as advertised in the Linux man pages for signals. If it turns out that signal information is missing via the Kernel - I have no qualms with submitting a few requests to the proper channels...

I've written some abstraction layer which employs epoll on linux and FD_xxx message notifications on win32. The typical use is serving up to several thousands of slow low-traffic connections concurrently with as low resources consumed as possible. Unfortunately I can't pull it out to publish as a library right now, though I planned to, eventually.

Nikolai

Show quoted text 5 lines
_______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Andrew Brunner
to Nikolai Zhubr

Thanks, Nikolai. epoll looks like the silver bullet (for linux) and very promising. I can dump a bunch of sockets into it and get the kernel to let me know which ones get notifications for reset/read/write.

But the abstraction is already accomplished in the foundational abstracted network server manager/worker threads unit that all protocols are implemented by.

Interesting reading :

(1) http://daniel.haxx.se/docs/poll-vs-select.html (2) http://www.kegel.com/c10k.html

I can't believe it has been this difficult to tie into *working* proven methods under Linux. I wonder if epoll was ever brought into Darwin... I did notice Apple making a quiet exit out of the Server market.

Thanks again!

Reply by email

Marco van de Voort
to Andrew Brunner

In our previous episode, Andrew Brunner said:

proven methods under Linux. I wonder if epoll was ever brought into Darwin... I did notice Apple making a quiet exit out of the Server market.

As said, BSDs (and afaik Darwin too) use kqueue/kevent. (kevent is e.g. for directory notifications).

Afaik kqueue is largely equivalent to epoll in functionality (and some people call it slightly more elegant even).

Note that this is all written in the first paragraph of the urls that you quote ( http://daniel.haxx.se/docs/poll-vs-select.html ) :-)

Reply by email

Andrew Brunner
to Marco van de Voort

Thanks Marco. I hope to get kqueue under darwin implemented shortly. But Linux was after Windows. Apple can wait.

Marco van de Voort wrote 18 lines
In our previous episode, Andrew Brunner said: > proven methods under Linux.  I wonder if epoll was ever brought into > Darwin...  I did notice Apple making a quiet exit out of the Server > market. As said, BSDs (and afaik Darwin too) use kqueue/kevent. (kevent is e.g. for directory notifications). Afaik kqueue is largely equivalent to epoll in functionality (and some people  call it slightly more elegant even). Note that this is all written in the first paragraph of the urls that you quote ( http://daniel.haxx.se/docs/poll-vs-select.html ) :-) _______________________________________________ fpc-devel maillist  -   http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Michael Van Canneyt
to Andrew Brunner: Thanks, Nikolai. epoll looks like the silver bullet (for linux) and very promising. I…
Andrew Brunner wrote
Thanks, Nikolai. epoll looks like the silver bullet (for linux) and very promising. I can dump a bunch of sockets into it and get the kernel to let me know which ones get notifications for reset/read/write.

...Which is what I suggested in the first reply to your original question.

Do note that you're back to polling, which I understood you wanted to avoid in the first place ?

Michael.

Reply by email

Nikolai Zhubr
to Michael Van Canneyt

02.01.2011 13:43, Michael Van Canneyt:

Show quoted text 12 lines
On Sat, 1 Jan 2011, Andrew Brunner wrote: > Thanks, Nikolai. epoll looks like the silver bullet (for linux) and > very promising. I can dump a bunch of sockets into it and get the > kernel to let me know which ones get notifications for > reset/read/write. ...Which is what I suggested in the first reply to your original question. Do note that you're back to polling, which I understood you wanted to avoid in the first place ?

Formally yes maybe, but Andrew probably meant just avoiding some horrible CPU-burning busy-loop.

Despite of the similar name (epoll), substantial shortcomings of classical polling scheme are gone. Say, you need not use a timeout to be able to handle any non-socket events like you were forced with select(), you can wait on descriptors of different types if you wish to, and you don't have to pass huge arrays all the way.

Nikolai

Show quoted text 7 lines
Michael. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Andrew Brunner
to Michael Van Canneyt: ...Which is what I suggested in the first reply to your original question. Do note that…
Michael Van Canneyt wrote
Do note that you're back to polling, which I understood you wanted to avoid in the first place ? Michael.

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.

SIGIO was giving me notice on socket closings and on datagrams ending in CRLF. I'm thinking there has to be a way to tell the kernel that this fd is a socket - and when that happens the kernel might send more signals eg.) like after a few ns after data stops streaming in or when MSG_MORE* isn't attached to the actual TCP/IP frame. But as an application we can't count on MSG_MORE being attached to each unfinished datagram (as in NetCat and Telnet).

Reply by email

Andrew Brunner
to Nikolai Zhubr: 02.01.2011 13:43, Michael Van Canneyt: Formally yes maybe, but Andrew probably meant just…
Nikolai Zhubr wrote 8 lines
Formally yes maybe, but Andrew probably meant just avoiding some horrible CPU-burning busy-loop. Despite of the similar name (epoll), substantial shortcomings of classical polling scheme are gone. Say, you need not use a timeout to be able to handle any non-socket events like you were forced with select(), you can wait on descriptors of different types if you wish to, and you don't have to pass huge arrays all the way.
From reading up on ePoll I came to understand that there is was a

period in time, about 3 years ago where there was a push for restful event driven signals for sockets. (SIGPOLL) is/was existing *nixs that have proven methods for socket signals on some platforms. Linux (at least my Ubuntu 10.10) handles SIGPOLL as SIGIO and waits for data ending in CRLF before sending my pid the signal. Having the kernel send me such a signal with the socket handle would be the most ideal situation because I already have core classes that organize/manage sockets in a high-scale, thread-safe way.

As Michael pointed out, and he and I both would benefit from having socket signaling under Linux, that employ no (rounding or transversing of socket elements) as it would be the most ideal environment.

Reply by email

Michael Van Canneyt
to Andrew Brunner: On Sun, Jan 2, 2011 at 4:43 AM, Michael Van Canneyt Sigh - yes, your right. I haven't…
Andrew Brunner wrote 15 lines
On Sun, Jan 2, 2011 at 4:43 AM, Michael Van Canneyt wrote: > Do note that you're back to polling, which I understood you wanted to avoid > in the first place ? > > Michael. 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.

Michael.

Reply by email

Andrew Brunner
to Michael Van Canneyt
Michael Van Canneyt wrote
All webservers I know use polling on unix, and they are what you might call 'high availablility' environments.

There is a big difference between HA and HP :-) While they are relationally proportional the cost of HA is minimized with efficient performance designed apps.

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.

Yes. Signalling is separate from processing using custom (thread safe) caching FIFO ptr lists :-) One list per event type. Reads/Writes/etc...

I recognize that no self respecting Linux buff would stoop so low as to copy anything microsoft. But event driven principals aren't owned by ms and gang. Event driven engineering is totally ideal for network sockets because you never know if/when data will arrive.

I also want to assert that ideal engineering principals, no matter who/where they come from must be seriously considered with extreme diligence as the lack of such is, at its core, the main reason why it has taken Linux so long to become widely adopted.

Microsoft has exercised ZERO restraint in picking off technologies and implementing them in their products even with disregard to intellectual property laws.

Ask yourself - why is it then we still see resistance in general Linux land to adopting good engineering principals? You know, along those lines, it could be possible, that at least in this case, Linux was up against IP law to which ms has asserted claim... If that is true as/if in this case I could see the hand being cut off to save the rest
- and we are absolutely stuck with ePoll from now until 10 years after the claim was filed

Reply by email

Henry Vermaak
to Andrew Brunner: period in time, about 3 years ago where there was a push for restful event driven signals…
Andrew Brunner wrote 20 lines
On Sun, Jan 2, 2011 at 5:24 AM, Nikolai Zhubr wrote: > Formally yes maybe, but Andrew probably meant just avoiding some horrible > CPU-burning busy-loop. > > Despite of the similar name (epoll), substantial shortcomings of classical > polling scheme are gone. Say, you need not use a timeout to be able to > handle any non-socket events like you were forced with select(), you can > wait on descriptors of different types if you wish to, and you don't have to > pass huge arrays all the way. >From reading up on ePoll I came to understand that there is was a period in time, about 3 years ago where there was a push for restful event driven signals for sockets.  (SIGPOLL) is/was existing *nixs that have proven methods for socket signals on some platforms.  Linux (at least my Ubuntu 10.10) handles SIGPOLL as SIGIO and waits for data ending in CRLF before sending my pid the signal.  Having the kernel send me such a signal with the socket handle would be the most ideal situation because I already have core classes that organize/manage sockets in a high-scale, thread-safe way.

What is stopping you from writing your own code that employs epoll in a thread to notify you of these events? You can always look to libevent for inspiration: http://en.wikipedia.org/wiki/Libevent. They have implemented this for a wide variety of back-ends.

Henry

Reply by email

Henry Vermaak
to Andrew Brunner: On Sun, Jan 2, 2011 at 9:07 AM, Michael Van Canneyt There is a big difference between HA…
Andrew Brunner wrote
I also want to assert that ideal engineering principals, no matter who/where they come from must be seriously considered with extreme diligence as the lack of such is, at its core, the main reason why it has taken Linux so long to become widely adopted.

What are these "ideal engineering principals"? Linux is the most popular os for high performance computing by _far_ (and has been for some time).

http://www.top500.org/overtime/list/32/os

Ask yourself - why is it then we still see resistance in general Linux land to adopting my engineering principals?

Fixed that for you.

Henry

Reply by email

Jonas Maebe
to Henry Vermaak
Henry Vermaak wrote 9 lines
On 2 January 2011 15:26, Andrew Brunner wrote: > I also want to assert that ideal engineering principals, no matter > who/where they come from must be seriously considered with extreme > diligence as the lack of such is, at its core, the main reason why it > has taken Linux so long to become widely adopted. What are these "ideal engineering principals"? Linux is the most popular os for high performance computing by _far_ (and has been for some time).

Please move this discussion to the fpc-other list.

Jonas
FPC mailing lists admin

Reply by email

Jonas Maebe
to Andrew Brunner
Andrew Brunner wrote 5 lines
On Sun, Jan 2, 2011 at 10:58 AM, Jonas Maebe wrote: > Please move this discussion to the fpc-other list. If by "this" discussion you mean "his" discussion then great.

I mean "discussions about the superiority of one programming paradigm over another", in particular in the context of "OS alpha is way better than OS beta" or "programmers of OS alpha are stupid for not adopting the obviously superior approach of OS beta". This list is about programming either OS alpha or beta, not about converting people from OS alpha to OS beta nor about rewriting/extending OS alpha to partially emulate the other one.

I've still got outstanding issues with SIGIO / SIGPOLL.

And those are welcome, although a Linux-specific programming list would most likely to be of more help (unless you start about how Windows does everything much better in your opinion; it depends on whether you want help or prove your point).

Jonas
FPC mailing lists admin

Reply by email

Andrew Brunner
to Jonas Maebe

I'm really surprised that I come off as sounding pro any OS. Personally, I'm the type of person to remove Windows 7 from my brand new laptop just to run Ubuntu. I think there is though, some sort of deep seeded resentment towards event driven methods.

So back to the topic... As it stands I do have SIGIO issues and am working on epoll. But since sigaction is preferable I'm searching for anyone with information as to how to get the kernel to define my sigaction and associate it with socket methods not Terminal IO. I think there is a flag I can set - I just don't have the value or name.

Reply by email

Sven Barth
to Andrew Brunner
Andrew Brunner wrote 10 lines
I'm really surprised that I come off as sounding pro any OS. Personally, I'm the type of person to remove Windows 7 from my brand new laptop just to run Ubuntu. I think there is though, some sort of deep seeded resentment towards event driven methods. So back to the topic... As it stands I do have SIGIO issues and am working on epoll. But since sigaction is preferable I'm searching for anyone with information as to how to get the kernel to define my sigaction and associate it with socket methods not Terminal IO. I think there is a flag I can set - I just don't have the value or name.

If you're desperate enough you could look how the Wine developers implemented Windows' event mechanism on Linux...

Regards,
Sven

Reply by email

Michael Van Canneyt
to Andrew Brunner: I'm really surprised that I come off as sounding pro any OS. Personally, I'm the type of…
Andrew Brunner wrote 10 lines
I'm really surprised that I come off as sounding pro any OS. Personally, I'm the type of person to remove Windows 7 from my brand new laptop just to run Ubuntu. I think there is though, some sort of deep seeded resentment towards event driven methods. So back to the topic... As it stands I do have SIGIO issues and am working on epoll. But since sigaction is preferable I'm searching for anyone with information as to how to get the kernel to define my sigaction and associate it with socket methods not Terminal IO. I think there is a flag I can set - I just don't have the value or name.

As far as I know, you can specify I_SETSIG on any file descriptor, also on sockets ?

Michael.

Reply by email

Nikolai Zhubr
to Sven Barth: If you're desperate enough you could look how the Wine developers implemented Windows'…

02.01.2011 22:46, Sven Barth:

Show quoted text 14 lines
On 02.01.2011 18:16, Andrew Brunner wrote: > I'm really surprised that I come off as sounding pro any OS. > Personally, I'm the type of person to remove Windows 7 from my brand > new laptop just to run Ubuntu. I think there is though, some sort of > deep seeded resentment towards event driven methods. > > So back to the topic... As it stands I do have SIGIO issues and am > working on epoll. But since sigaction is preferable I'm searching for > anyone with information as to how to get the kernel to define my > sigaction and associate it with socket methods not Terminal IO. I > think there is a flag I can set - I just don't have the value or name. If you're desperate enough you could look how the Wine developers implemented Windows' event mechanism on Linux...

LOL, this was also my first idea when I started thinking about porting my app to linux. Subsequently it prooved absolutely unnecessary. Moreover, I found that epoll-based implementation is much safer than winapi-based implementation regarding both programmer's mistakes and , epoll inventors were pretty smart
in this respect, imho.

[Sorry for getting offtopic again, I promise to stop at this point.]

Nikolai

Show quoted text 8 lines
Regards, Sven _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email