Asio uses async_result to transparently provide use_future, yield_context or completion handlers in its API interfaces.ยน
Here's how the pattern goes:
template <typename Token>
auto async_meaning_of_life(bool success, Token&& token)
{
typename asio::handler_type<Token, void(error_code, int)>...
Slowly getting the hang of that async_result dance. Asio's design is really quite brilliant in many details like this this.
I've been exploring ways to avoid packet loss in the Rx path. Finally realized I really need to approach it as a (soft) real-time problem. Doing that drastically improved the results.
Basically I have around 30 microseconds before the network buffer becomes full and starts dropping packets. I measured the old code and found there were outliers were it sometimes ended up waiting for 30 milliseconds. (1000 times too long).
Using the SCHED_FIFO real-time policy got rid of most of the outliers. Also needed to remove an allocation in the hot code.
That's probably not needed since I'm not making system calls inside the hot code. I'm using Intel's DPDK library which has special drivers that let you access the network card directly from user space.
> Furthermore, SCHED_FIFO tasks have to voluntarily yield the processor back to the scheduler either through a system call or through calling sched_yield, in other words, that task cannot be interrupted by any of the normal tasks that are running in the linux environment (except, of course, by a task running with the same SCHED_FIFO policy and a higher static priority!).
> So, if your program has a bug, gets into an infinite loop and does NOT yield back to the scheduler the whole computer will freeze.
@wilx I'm testing it right now. It's a trainwreck.
The ISO won't even boot up on my system. After searching around, I got it to boot by disabling ACPI. Once I got in, everything looks different. And I couldn't scale my DPI to 150% since it only has options for 100%, 200%, and 300%. IOW, it's hard to use my 4k monitor.
@BartekBanachewicz Many (most?) of the circuits people post there are puny bits of nearly nothing. Like on SO, any are homework like: "compute the current through R1" in a circuit with a battery and three resistors.
Oh man. I long back to the times when YT's algorithms would simply get me lost on the wrong side of YT. Twitter sent me to this fringe
That treatise is a master-piece of strawman rhetorics under a thick layer of "come on now, don't be ridiculous".
I wonder how many people that actually works on.
So they quote a cogent argument made by someone who they claim to be "nearly-allies" because they admit that "children can enjoy sex with adults":
> 'PIE are ignoring a child's other interests apart from pleasure. Is the function of childhood to have a good time, or to learn how to form trusting relationships and acquire skills that will be useful later on? Hedonism comes pretty low on the list, I would have thought.'
And they think they can make it worthless with a whole slew of "counter-points" all resembling this:
> "The fact is that children are no less likely to be able to learn maths or geography as a result of involvement in a sexual relationship."
@fredoverflow ok I guess... People looked to be paying attention and intersted, but not really any questions afterwards. I really doubt I'll see the language being used at work, but that's the nature of the job ¬_¬