🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1703

Re: Inversion-of-control and dependency-injection in C

#1703
From: Ross Finlayson
Date: Fri, 20 Nov 2026 14:18
31 lines
3332 bytes
On 11/20/2026 06:13 AM, Tristan Wibberley wrote:
> On 17/11/2026 09:00, Ross Finlayson wrote:
>
>> I'm under the impression that there's a race-condition where
>> the process gets a signal while blocked in epoll_wait, then according
>> to one of two policies, EAGAIN error-handling or re-try, that it
>> loses the notification, not the packet. The packet is still on
>> the socket to be read, the notification of it was lost.
>
> Perhaps a bit offtopic, but I think this has been understood from before
> edge-triggering was introduced to Linux with epoll in the first place:
> one must *always* try the resource in nonblocking manner after
> processing all notifications. It is the nature of the mode. The error is
> in your assumptions.
>
>
>

Thanks for writing. The point is that then the poller must try to
read _all_ the open connections, that the notification was lost,
which introduces an exception-case, over all the opening connections,
outside of the busy-loop, over the notified connections, according to
a case which depends on signal-handler conventions to indicate exist,
and always being checking that before entering a blocking operation.

With the level-triggered then the notifications are always present.

So, agreeably, that's well-defined by the difference of the behaviors
about edge-triggering vis-a-vis level-triggering, it is what it is.

Technical Details
Message-ID: <3cGcndTouJJTy532nZ2dnZfqn_SdnZ2d@giganews.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <yQOdnQ-qnKiiZ2j3nZ2dnZfqn_udnZ2d@giganews.com> <11d56gl$3ud5q$1@dont-email.me> <11d6vjp$qhu8$1@raubtier-asyl.eternal-september.org> <dsednTD-Fblclmr3nZ2dnZfqnPWdnZ2d@giganews.com> <11d738r$ru7a$1@dont-email.me> <11d75i7$spj0$1@dont-email.me> <11d7c8k$173nk$1@dont-email.me> <11d7fbv$1839o$2@dont-email.me> <nrecnTdvuvbACWr3nZ2dnZfqn_adnZ2d@giganews.com> <11dfgtf$3pj6i$1@raubtier-asyl.eternal-september.org> <dmKdnV8-pPdQ_Gb3nZ2dnZfqnPadnZ2d@giganews.com> <11dfrgp$3te4n$3@dont-email.me> <45-dnT0eC7C5hWH3nZ2dnZfqnPadnZ2d@giganews.com> <11dpkis$37fna$2@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 20 Nov 2026 14:18:53 +0000
Subject: Re: Inversion-of-control and dependency-injection in C
Newsgroups: comp.lang.c
References: <yQOdnQ-qnKiiZ2j3nZ2dnZfqn_udnZ2d@giganews.com>
 <11d56gl$3ud5q$1@dont-email.me>
 <11d6vjp$qhu8$1@raubtier-asyl.eternal-september.org>
 <dsednTD-Fblclmr3nZ2dnZfqnPWdnZ2d@giganews.com>
 <11d738r$ru7a$1@dont-email.me> <11d75i7$spj0$1@dont-email.me>
 <11d7c8k$173nk$1@dont-email.me> <11d7fbv$1839o$2@dont-email.me>
 <nrecnTdvuvbACWr3nZ2dnZfqn_adnZ2d@giganews.com>
 <11dfgtf$3pj6i$1@raubtier-asyl.eternal-september.org>
 <dmKdnV8-pPdQ_Gb3nZ2dnZfqnPadnZ2d@giganews.com>
 <11dfrgp$3te4n$3@dont-email.me>
 <45-dnT0eC7C5hWH3nZ2dnZfqnPadnZ2d@giganews.com>
 <11dpkis$37fna$2@dont-email.me>
From: Ross Finlayson <ross.a.finlayson@gmail.com>
Date: Fri, 20 Nov 2026 06:18:40 -0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <11dpkis$37fna$2@dont-email.me>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <3cGcndTouJJTy532nZ2dnZfqn_SdnZ2d@giganews.com>
Lines: 31
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-lBnEtuF0N3A6IHdvMWeM4vZAI73GJU07lQr7jV/L6Lc/08nQBsQRxhVKM2n+oYbzIWevJz8PQnwEpvS!KVtWD/3j3hl89m+qkjKf4DarWv6KP36OcvKd5MqyLZc+BZqMxW8gdEssAJYx8ioaMnXbrhceauaQ
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40