On Tue, Apr 1, 2025 at 10:24 AM GoStriver <wk100000...@gmail.com> wrote:
>
>
> I noticed that the source code mentions in many places that timers depend on 
> netpoll. However, I understand that timers are triggered via 
> pp.timers.check() within findRunnable(). How exactly do timers rely on 
> netpoll then? Am I missing something here?

A key aspect of timers in any language is how to ensure that an
otherwise idle program handles timers at the appropriate time. In the
Go runtime implementation that is done via netpoll. In an otherwise
idle program, a thread will be waiting for any network I/O, with a
timeout. That timeout is set such that the thread will wake up when it
is time for a timer to fire. The operation of waiting for network I/O
with a timeout is handled by netpoll.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcV3TndvnZ7zyh3%2BS%3DjgK%2BEppGiMvu7nDerUGmfcv%2B6ONA%40mail.gmail.com.

Reply via email to