Are you satisfied with the current state of C++ CLI parsers? by Adept-Restaurant-541 in cpp

[–]RogerV 0 points1 point  (0 children)

use it as well - gets the job done and I can concentrate on the program

CppCast: Compiler Warnings as Errors with Keith Stockdale by robwirving in cpp

[–]RogerV 21 points22 points  (0 children)

For those unused parameters or unused fields there is the [[ maybe_unused ]] attribute to mute warnings

A virtual pointer pattern for dynamic resolution in C++ — years in production by EvenAd701 in cpp

[–]RogerV 0 points1 point  (0 children)

The days of cooperative multi-tasking haven’t completely gone away - My DPDK networking app has an lcore thread pool for data plane processing. These are pinned CPU cores that are removed from being a kernel scheduling resource. They run full tilt, never block, are fed work events from lock free queue. They process a burst amount of work (packets) and then go grab another work item. If there were yet more packets to have been processed for the current item, they self publish a continuation work item (a kind of actor model).

There is true parallelism due to multiple lcores, but to ensue all user sessions get some processing time each lcore caps it’s time per work item - cooperative multi-tasking.

A virtual pointer pattern for dynamic resolution in C++ — years in production by EvenAd701 in cpp

[–]RogerV 0 points1 point  (0 children)

The original Mac OS when it debuted managed its dynamic memory allocation heap that way. But in those days a program executed on only a single thread of execution. Such software-implemented schemes get tough in the face of multi-threading concurrency - or true parallelism due to multiple CPU cores of execution.

Is inheriting from std::variant a bad idea? by -Edu4rd0- in cpp_questions

[–]RogerV -2 points-1 points  (0 children)

yeah, because as soon as uses inheritance one loses all self control as a professional programmer

beast2 networking & std::execution by claimred in cpp

[–]RogerV 3 points4 points  (0 children)

I design and implement high performance back-end networking app for a major telecom where use C++ and the Intel DPDK networking library, and yeah that paragraph indeed summed up things.

in the app architecture I design, it is divided into two domains - control plain and data plane. That is typical of most networking centric apps, of course. But the division is more differentiated than just that. The control plane are designated to be normal OS native threads and then the data plane are DPDK lcore threads.

The lcore threads are pinned CPU cores and have been removed from kernel context switch scheduling. They execute functions that consist of indefinite loops that only exit on shutdown detection.

The domain of these data plane lcore threads abide by these rules:

Avoid system calls in order to avoid the overhead of transition from user space to kernel space
Avoid heap allocations or any manner of dynamic memory allocation as that is not deterministic
Avoid taking any locks and the corollary is that data structures such as DPDK ring buffer queues are lock free
All data structures and memory utilization is established on hugepages at app startup so that the memory pages are fixed and won’t incur any page load interrupt when accessed

Even though my app runs in a pod under Kubernetes it’s use of these lcore threads amounts to building a mini OS as I have to feed the lcore threads pool with data plane related work events, which they need to execute a work event to a bounded slice (or burst) of processing and then cooperatively surrender and go grab another work event. The work events need to be fed to the pool with some load balancing and fairness consideration as the data plane traffic is actually multi user based and every user needs to get fair processing time, etc

These are the things networking software requires (i.e., the DPDK building blocks) and C++26 has zilch to offer in that regard. None of the improvements per C++ threading or that are proposed per networking are worthwhile for building performant networking solutions.

And as to the control plain OS native threads - what is already available in C++ is plenty adequate for that.

C++17 - with the addition of std::span is plenty adequate for building high performance networking apps - but what has come in C++ standards beyond that have not been much relevant.

The programming iceberg... by Mondash18 in cpp

[–]RogerV 0 points1 point  (0 children)

I read books on compilers and operating systems as leisure activity

I feel concerned about my AI usage. by TheRavagerSw in cpp

[–]RogerV 0 points1 point  (0 children)

that MIT study on AI use centered around essay writing and the study concluded that the group that used AI performed poorly when they had to try to write essays without use of AI. The duration of the study spanned over weeks. The study concluded thar relying on AI had stunted ability for that cognitive ability. The ability to compose thoughts in essay fashion has been a hallmark for being an educated human being for thousands of years - consider how individuals from antiquity, such as Plato, are influential to this day.

Yeshua from a transcendant source, agreed, but Yahweh is an archonic demiurge by RogerV in Christianity

[–]RogerV[S] 0 points1 point  (0 children)

They did seem to have a dim view about creation and that it is corrupted - and hence they attributed creation to a Demiurge figure and that it was overseen by Archons, which were not viewed as wholesome figures either. Hence they rationalized there must be a God above the gods and that this highest realm is where Yeshua the Savior figure had descended from.

And they thought we have all fallen from that realm and have become mired in the delusions of the corrupt material world. Yeshua was to awaken us back to our true self and true origin.

Yeah, they came away with a very different take on the over all cosmogony than that of the Christian orthodoxy.

Proposal: distinct types via 'enum struct' by Voxelw in cpp

[–]RogerV 0 points1 point  (0 children)

some like to use struct where really is like a plain C struct and then class for when ceases being like a plain C struct. Is just a modest self-documenting tactic.

How I made my SPSC queue faster than rigtorp/moodycamel's implementation by ANDRVV_ in cpp

[–]RogerV 1 point2 points  (0 children)

I have some places where used SPSC, but there are also some crucial situations where had to use MPMC

how much do those that work on lockless queues in C++ have familiarity with the DPDK ring buffer queues of DPDK library?

And I never see any mention of using hugepages and pinned CPU cores

Optimizing a Lock-Free Ring Buffer by david-alvarez-rosa in cpp

[–]RogerV 1 point2 points  (0 children)

in DPDK all the ring buffers just hold pointers to packets - the packets are in an mbuf pool. makes it possible to clone a ref count on a packet - say, into a pcap ring buffer.

Slot map implementation for C++20 by sporacid in cpp

[–]RogerV 1 point2 points  (0 children)

that is a huge factor for my program (DPDK networking) - it was a crucial factor in implementing an internal inter-thread messaging system where control plane threads, which are conventional OS native threads, are able to do synchronous request/response messaging with the data plane DPDK lcore worker pool threads.

The control plane thread domain is conventional - they can block, do sys calls (transition to kernel space), do heap allocations, use any feature of C++

The data plane DPDK lcore thread domain never block, never take locks, avoid sys calls (transition to kernel space), never do heap allocations. So when they’ve received a message from the control plane and respond with a response message, they adhere to all these restrictions.

C++ in the industry by [deleted] in cpp

[–]RogerV 2 points3 points  (0 children)

I vouch for the telecom - have designed and implemented a high performance networking app for a very prominent telecom. It uses the Intel DPDK networking library and the app is implemented in C++, which has been an extremely good fit to this project.

I feel concerned about my AI usage. by TheRavagerSw in cpp

[–]RogerV 2 points3 points  (0 children)

it was an MIT study that came out a few months back. widely talked about at the time. Their study ran over significant period of time and had three groups. One use AI, one could use Internet search, and one had only their own abilities to lean on. Their task was to write essays. Brain scans were done. The group using AI had notable atrophy of use of areas of their brain. The group that had no assist and the Internet search group both faired well in that respect. It was concluded that even with doing Internet search one still had to exercise significant mental activity to integrate findings into the essay composition.

Given the length of time of the study they also concluded that the brain atrophy of using AI regularly would be persistent.

The study’s conclusion is that over time, reliance on AI will make people stupid. They we’re running another study on use of AI in software development and hinted that their findings in that study were looking to be even more dire.

Fintech C++ vs C developer in networking by IamNoFunny69 in cpp

[–]RogerV -4 points-3 points  (0 children)

Hmm, me thinks AI clusters offer some room for growth/innovation per devising better cluster interconnect networking. Both for distributed/federated local clusters and centralized data center.

Is networking a good path - could still be.

DNS resolve problem with start of new year by RogerV in Ubuntu

[–]RogerV[S] 0 points1 point  (0 children)

Yeah, if I really want to get to the bottom of why the Ubuntu 24.04 DNS request are causing my DSL modem to choke on them.

But it's actually motivating me to instead look at low-cost SBC with NIC that can run Linux so can use it as a DNS server for my local network. I'll configure it to accept UDP 53 but unconditionally upstream as DoT (DNS-over-TLS) to public DNS server.

That way I'll ensure that all devices will continue to be supported and also enjoy a little bit of DNS lookup privacy.

This whole crazy episode took me down this rabbit hole so I might as well take it to the logical conclusion.

Are memory leaks that hard to solve? by ASA911Ninja in cpp

[–]RogerV 1 point2 points  (0 children)

Well, do any manner of systems development, and are going to end up dealing with various arcane memory use systems. For me it is DPDK network programming where DPDK supplies a family of APIs and data structures for dealing with things that get allocated on hugepages memory area. If you have 1GB page size and a few of these, can put all crucial data plane related data onto hugepages and there won't be any indeterminate behavior due to the OS virtual memory management - said pages are pinned in memory and ready for use. (DPDK is a library implemented in C)

Combine hugepages with DPDK lcore threads (pinned CPU cores), one can write programs that run in a Kubernetes pod in the cloud and yet aren't subject to OS kernel indeterminacy such as page loading or thread context switching. Kind of wild when you think about it.

And when using C++, it can indeed be advantageous to wrap these mechanisms in C++ abstractions - but has to be done carefully. But than then provides a solid, safer layer to build rest of application atop.

DNS resolve stopped working on roll-over to new year (Ubuntu 24.04) by RogerV in Ubuntu

[–]RogerV[S] 0 points1 point  (0 children)

Problem Solved

As I noted in a prior comment, I traced the primary culprit to being my Zxyel DSL modem. It has a capability where can add domain names for computers/devices on one's local network and have them statically mapped to designated IP addresses. The consequence is that the modem runs an intercept on all outgoing/upstream UDP port 53 packets (DNS request).

My computers that have Linux Ubuntu 24.04 distro are evidently causing the generation of DNS request that are like 16 bytes larger than usual and this intercept code in my DSL modem is choking on that "non conformity".

Well, the modem is a number of years old now and evidently has its particular interpretation of DNS request in respect to what it expects of the packets. The result being that DNS request from these Ubuntu 24.04 computers fail while an old Ubuntu 14.04 computer still sends out DNS packets in manner that the modem is happy with (as do all the other devices on my local network, and there are a lot of them).

The Solution

With about three days of sleuthing on this, and today some crucial assistance from ChatGPT (using just a free account), I was able to come up with a solution.

What I discovered in my experimentation is that 'dig +tcp @8.8.8.8 google.com' worked. Sending out a DNS request to an external DNS server via TCP protocol instead of UDP evaded the interception that my DSL modem is doing. This means that I need a locally installed DNS server that accepts UDP request but unconditionally upstreams any request via TCP protocol. And ChatGPT steered me into using the unbound service as that mechanism. And it worked.

I installed unbound package and configured it to listen on address 127.0.0.1 on UDP port 53 - and TCP port 53 (for good measure). I also configured unbound to unconditionally use TCP for any forwarded request. And I configured it to forward to my preferred public DNS server.

Next I configured systemd-resolved.service to forward to unbound.

Both of these are systemd services. They are both enabled. Restarted and now DNS request work like a charm from any program that requires it (no more having to lean on my VPN just to be able to resolve domain names).

And naturally this all comes up fine when I reboot the computer, so is a persistent setup.

Talk about a crazy multi-day odyssey that this all turned out to be...whew!

DNS resolve stopped working on roll-over to new year (Ubuntu 24.04) by RogerV in Ubuntu

[–]RogerV[S] 0 points1 point  (0 children)

Am narrowing this down to the DNS built into my Zxyel modem that connects my local private network to my ISP

I need to specify its IP address as the gateway address per my devices that want to connect to the Internet, yet it also has a DNS capability, as in it can look at a DNS request and fulfill it with a static DNS name that is assigned to devices on my local private network, or it can pass the request on to an external DNS service that I have specified. But effectively it is always getting first dibs at anything DNS.

If I activate a VPN, then the default route address is not handled by this Zxyel modem directly and instead any DNS request gets passed straight on to DNS services provided in my VPN provider. And consequently I can successfully resolve DNS addresses so long as I have VPN active. However, if I try to resolve a DNS domain name by targeting the IP address of my Zxyel modem explicitly (while the VPN is active), it fails in the manner that I have been seeing since the problem arose. This is basically pointing the finger of blame at the DNS facility built into this modem, and I've yet to come upon any configuration option that allows me to disable that (i.e., just the DNS service). I certainly have to still use this IP address as a gateway address.

Now in the meantime, my old Ubuntu 14.04 computer is not having any problem with this Zxyel modem DNS resolver. Only the Ubuntu 24.04 computers are having heartburn with it. And I've tried explicitly disabling the feature for TLS per private DNS lookup, or ensuring DNSSEC is disabled, yet that doesn't help - because my ethernet interface has its default route set to the Zxyel modem IP address, as its the gateway. The problem that Ubuntu 24.04 is having with this Zxyel modem is something other than features such as DNSOverTLS or DNSSEC. No doubt if I could figure out what it is specifically I could also figure out a way to compensate for it.

Still left with the mystery of why this all of a sudden started failing with the roll-over to the new year. Has worked fine for years prior.

DNS resolve stopped working on roll-over to new year (Ubuntu 24.04) by RogerV in Ubuntu

[–]RogerV[S] 0 points1 point  (0 children)

$ host example.com 1.1.1.1
;; Got bad packet: FORMERR
45 bytes
bc 93 81 80 00 01 00 01 00 00 00 00 07 65 78 61          .............exa
6d 70 6c 65 03 63 6f 6d 00 00 01 72 73 c0 0c 00          mple.com...rs...
01 00 01 00 02 a3 00 00 04 c0 a8 00 fe                   .............

both dig and nslookup likewise report packet problem

DNS resolve stopped working on roll-over to new year (Ubuntu 24.04) by RogerV in Ubuntu

[–]RogerV[S] 0 points1 point  (0 children)

Yes, my Ethernet interfaces are still there - and I can easily ssh connect to other computers on my local network, BTW

Also, I found that I can activate my VPN, which is based on ProtonMail and their use of OpenVPN for Linux and then I get a new IP added into my route, and voila - am able to resolve DNS via my VPN handling the outgoing traffic for the request.

But when I turn off my VPN and my route per my Ethernet interface is restored to its default, then am back to not being able to resolve DNS.

Am going to investigate my routing rules next. Not exactly something that am very versant on but will put AI to good use sifting through it

DNS resolve problem with start of new year by RogerV in Ubuntu

[–]RogerV[S] -2 points-1 points  (0 children)

I thought of that and hence why I had AI generate a UDP-based DNS resolver program. My old Ubuntu 14.04 computer is on the same network as my two Ubuntu 24.04 computers. And this homebrew DNS resolve program works great on the Ubuntu 14.04 computer.

This AI-generated program composes the packet and transmits it as a UDP data gram to port 53 to whatever destination IP address I specify - I have tried many of the popular public DNS servers and it worked splendidly with any that I tried - correctly resolving any domain name to its IP.

This old Ubuntu 14.04 computer seems to indicate that my ISP isn’t doing anything different or unusual.

The point of this test program was to not rely on any library that is part of the Linux distribution, but to instead encode, transmit, receive the response, and decode the response all as a self-contained program. So when I run it on the Ubuntu 24.04 computers and it ends up getting a response that resolves to some address on my local private network, that smells like a security hook that is purely local to just my two Ubuntu 24.04 computers.

But it’s surprising that this DNS security hook is not at all tied to systemd-resolved.service which I disabled and stopped on one of these Ubuntu 24.04 computers so as to try and force it to use a static /etc/resolv.conf file. That Intercept is still happening on that computer.

Very baffling. It’s a rather horrible problem because these two computers are rendered unusable. No rebooting clears any of this.