Deutsch English Français Italiano |
<vs6k3a$359tg$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> Newsgroups: comp.arch Subject: Re: MSI interrupts Date: Fri, 28 Mar 2025 09:51:54 -0700 Organization: A noiseless patient Spider Lines: 29 Message-ID: <vs6k3a$359tg$1@dont-email.me> References: <vqto79$335c6$1@dont-email.me> <7a093bbb356e3bda3782c15ca27e98a7@www.novabbs.org> <vs41ap$n43$1@reader1.panix.com> <34434320650f5844b18b1c0b684acf43@www.novabbs.org> <vs5305$rd4$1@reader1.panix.com> <cb049d5490b541878e264cedf95168e1@www.novabbs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 28 Mar 2025 17:51:55 +0100 (CET) Injection-Info: dont-email.me; posting-host="7ce1f9b3539f865da57caab62bfa1cad"; logging-data="3319728"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JtCxGyJ+zrSJ2R7jks7sIj6P5n26qzl4=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:+qxKVzD60RGpbU8BfpJeY/QM5gY= Content-Language: en-US In-Reply-To: <cb049d5490b541878e264cedf95168e1@www.novabbs.org> Bytes: 2435 On 3/28/2025 8:24 AM, MitchAlsup1 wrote: > On Fri, 28 Mar 2025 2:53:57 +0000, Dan Cross wrote: [...] > > Generally when I write queue-code, I use a dummy Node front/rear > such that the checks for Null are unnecessary (at the cost of > following 1 more ->next or ->prev). That is Q->head and Q->tail > are never NULL and when the queue is empty there is a Node which > carries the fact the queue is empty (not using NULL as a pointer). > > But that is just my style. Actually, it's a fairly common practice to use a dummy node in lock/wait-free queues. For instance: https://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html In fact, wrt the C++20 futex stack code I posted to this group uses a dummy address: #define CT_WAIT ((ct_node*)0xDEADBEEF) To define a wait state for the C++20 futex to use wrt avoiding slow-paths. However, this scares me a bit because if the user allocates a node that has that exact address, it will break the algorithm. So, I really should create a dummy node and use that for the wait condition. Have you seen that post "Futex Stack..."?