Re: Manipulating C code at the AST level, in C
The Natural Philosopher <[email protected]>
| Newsgroups | comp.os.linux.misc |
|---|---|
| Organization | A little, after lunch |
| Message-ID | <[email protected]> |
On 15/08/2026 12:07, Jim Jackson wrote: > On 2026-08-15, c186282 <[email protected]> wrote: >> On 8/14/26 07:26, Nuno Silva wrote: >>> (Given I'm commenting on the content of the online manual on a Linux >>> system, I'm adding and followingup-to comp.os.linux.misc.) >>> >>> On 2026-08-11, Lawrence D???Oliveiro wrote: >>> >>>> On Mon, 10 Aug 2026 17:41:30 -0300, Anton Antimo wrote: >>>> >>>>> For select (called unix-fast-select in SBCL), see sb-unix. >>>> >>>> select(2) is considered an archaic way of doing things these days, >>>> because of its ABI limitations. The modern way is poll() >>>> <https://manpages.debian.org/poll(2)> (POSIX) or even epoll() >>>> <https://manpages.debian.org/epoll(7)> (Linux-specific). >>> >>> The online manual here (a GNU/Linux system) says: >>> >>> "poll, ppoll - wait for some event on a file descriptor" >>> >>> Perhaps that should be rewritten. Reading further, it's not singular, >>> but that description with "*A* file descriptor" does make it sound like >>> poll is not a suitable replacement for select. >> >> >> Polling, for this sort of thing, has to be >> fast and constant - a big CPU drag. You are >> basically WAITING for something to happen - >> which MAY or may NOT happen at any moment. > > Despite the names, these functions WAIT for events. > Yes it could be sort of confusing. > Normal mechanism would be to put the calling thread into suspense, and trigger a resume by setting a flag from interrupt. The thread then 'resumes' and checks to see why it was woken up. AFAICT from a cursory glance there is no difference between select and poll 'under the hood'. They just present themselves differently -- Civilization exists by geological consent, subject to change without notice. – Will Durant