Re: Manipulating C code at the AST level, in C

rbowman <[email protected]>
Newsgroups comp.os.linux.misc
Message-ID <[email protected]>
On Fri, 14 Aug 2026 23:47:19 -0400, c186282 wrote:

>    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.

I used select() rather than poll() but I'm archaic. Typically the select 
call was in the main loop. The timeout was often 1 second. If the call 
returned a ready fd you took care of business. If it timed out, then you 
did whatever housekeeping was necessary, making sure it wasn't a long 
process.

Without the select the main loop would chew up 100% of the CPU. Interrupt 
have their place but often complex ISRs are used that aren't any faster 
than polling.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.