🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1713

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

#1713
From: Tristan Wibberley
Date: Fri, 20 Nov 2026 17:42
51 lines
4182 bytes
On 20/11/2026 17:32, Tristan Wibberley wrote:
> On 20/11/2026 14:18, Ross Finlayson wrote:
>> 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,
> 
> 
> oh! There's a buffer that isn't big enough for one record for each
> resource? That's a surprise. I'd supposed O(1) records for each
> notifiable resource so that you'd only have to do one extra poll for
> each resource that you'd used rather than each that could have had
> useful availability.


I can't see that the API causes it. Is it an implementation bug? I
understand that there is not a notification due for each event but for
each ready resource.

Is it some specific resource whose notification implementation is
defective? A flag, semaphore or similar should suffice, rather than a queue.


-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Technical Details
Message-ID: <11dq0qu$3co9l$2@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.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> <3cGcndTouJJTy532nZ2dnZfqn_SdnZ2d@giganews.com> <11dq06m$3co9l$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tristan Wibberley <tristan.wibberley+netnews2@alumni.manchester.ac.uk>
Newsgroups: comp.lang.c
Subject: Re: Inversion-of-control and dependency-injection in C
Date: Fri, 20 Nov 2026 17:42:54 +0000
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <11dq0qu$3co9l$2@dont-email.me>
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>
 <3cGcndTouJJTy532nZ2dnZfqn_SdnZ2d@giganews.com>
 <11dq06m$3co9l$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 20 Nov 2026 17:42:54 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3563829"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18ckcAWw+h+iRBLODCNGyVjb8mwXE6dRCPFvwK+NTw2fQ=="; posting-host="637de20a231e00d4ef7d496fe9f23904"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rMCH9nlqiay/oJv8T2aiENd1q80= sha256:U8yaoOBm2RGJRhPpbEEqCXiwsdUnkY89okGYAkm0RMY=
	sha1:bHcg+dL/v3axLzZ0KqQHQeAjN5c= sha256:zBEgFdOwRAu3OFYItdeCcjfY+IrWcGVga0mNcnw4wxc=
Content-Language: en-GB
In-Reply-To: <11dq06m$3co9l$1@dont-email.me>