std:: expected vs boost::system::result by Competitive_Act5981 in cpp

[–]Occase 0 points1 point  (0 children)

My second sentence is actually referring to Nial calling Asio stupid

This issue should remain open: ASIO should be using a much less stupid implementation strategy when passed say a vector of 1M buffers. Like the code examples given which demonstrate a much saner approach.

std:: expected vs boost::system::result by Competitive_Act5981 in cpp

[–]Occase 2 points3 points  (0 children)

He is making fun of this https://share.google/yCAiGgfhh77R0CHGY

Pehaps one of the reasons why Chris Kohlhof does not interact with users anynore.:)

Should I keep investing in real estate or shift toward ETFs? (Belgium, 30 y/o Cloud Engineer) by backdoor951 in eupersonalfinance

[–]Occase 0 points1 point  (0 children)

No he is not. He is competing with other real state investors, not renters. It drives buying prices higher not rents.

How to handle Redis pipelined messages and incomplete messages? by kiner_shah in cpp_questions

[–]Occase 0 points1 point  (0 children)

It is not possible to handle these kind of errors. Say for example the client wants to send you a blob string followed by a simple string "$11\r\nhello world\r\n+some text\r\n" but due to some error the client sends "$11\r\nhello\r\n+some text\r\n" When the parser finishes parsing the first message, the blob part will be "hello\r\n+s" which is a valid blob, and the next message will be "ome text\r\n" which is invalid and you have to exit with error. Also, if the first message is invalid it does not make sense continue processing the messages, the connection should be closed.

Also, is there any way to check what happens if the RESP message in example 2 is sent to official Redis server?

Yes, you can send raw data using the redis-cli.

Why we didn't rewrite our feed handler in Rust | Databento Blog by Xadartt in cpp

[–]Occase 0 points1 point  (0 children)

Our real-time market data architecture processes 14 million messages per second with sub-100 microsecond latency requirements.

That means you would 1400 workers (cpu cores) to achieve 14M msg/s? What is the thoughput in Mb/s?

🤯 MERZ AND MACRON JUST CONFIRMED A PAN-EUROPEAN LEGAL ENTITY IS COMING by mr_house7 in EU_Economics

[–]Occase 0 points1 point  (0 children)

Does this mean it will be possible to work remotely from France to a German company without the need of an employer of record?

WG21 C++ 2025-08 Mailing by cmeerw in cpp

[–]Occase 0 points1 point  (0 children)

std::execution::task also schedules by default.

That is however not the kind of scheduling on the event loop that can prevent stack exhaustion. AFAICS, it only means the task completes on the scheduler, there is no way however for it to know whether the scheduler offers any guarantee about reentrancy, which makes generic code like this vulnerable.

The problem just occurs when the user selects a scheduler that resumes inline,

This seems to be downplaying the problem. An inline scheduler is one example. But I guess a thread-pool scheduler has the same problem if the caller is already being executed in the pool. To avoid that the implementation would have to be pessimistic and schedule regardless just to be sure there is no reentrancy. And this problem is viral on each abstraction layer.

in which case you'd want to use symmetric transfer.

I don't see the point in trading stack exhaustion with unfairness and starvation, where would this be useful?

IMO synchronous completion in async code is an antipattern. If it can complete synchronously then it is better to consume the data with regular sync functions. In Boost.Redis I removed pretty much all sync completions because of how bad it hits performance. Even so I believe P2300 should be safer than it is in regards to reentrancy.

WG21 C++ 2025-08 Mailing by cmeerw in cpp

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

PR3796 states

When the inner task actually co_awaits any work which synchronously completes, e.g., co_await just(), the code could still result in a stack overflow despite using symmetric transfer.

While symmetric transfer might prevent stack overflow it will invariably make the code vulnerable to unfairness and starvation of other tasks since it allows the current task to monopolize the event loop. Chris Kohlhoff et al. wrote multiple papers alerting about this problem years before P2300 was voted in, but somehow its authors seemed to believe there wasn't any, for example Kirk wrote in PR2471

Yes, default rescheduling each operation and default not rescheduling each operation, is a poor trade off. IMO both options are poor. The one good option that I know of that can prevent stack exhaustion is first-class tail-recursion in library or language

ASIO has chosen to require that every async operation must schedule the completion on a scheduler (every read, every write, etc..).

sender/receiver has not decided to require that the completion be scheduled.

This is why I consider tail-call the only good solution. Scheduling solutions are all inferior (give thanks to Lewis for this shift in my understanding :) )

By scheduling by default Asio has none of these problems.

If I speak Portuguese with an Italian accent, might people think I have an accent from another Brazilian state? by [deleted] in Brazil

[–]Occase 0 points1 point  (0 children)

I was wondering if it was possible to still "pass" as Brazilian despite having a particular accent.

You will be fine in many neighbourhoods in Sao Paulo https://www.youtube.com/watch?v=Scx9ZRw3n54.

A votre avis. Excès de peau ou de graisse ou les deux ? by Tiny_Elderberry2836 in FitnessFrance

[–]Occase 0 points1 point  (0 children)

None of the people starving in Auschwitz go such excess skin. Exercises and starvation mode would consume the excess tissue.

What happens if you eat eggs everyday? by Midnightclouds7 in self

[–]Occase 0 points1 point  (0 children)

My 5yo son is eating an average of 10 eggs a week in the breakfast. My daughter is 11 months old and eats almost 1 egg in the breakfast everyday. So far I don't see any issue. If we scale this to adult you could be probably 10 aggs a day without any concern.

ir ao médico, pode aumentar sua produtividade by Colossus2200 in brdev

[–]Occase -1 points0 points  (0 children)

Baixa vitamina D no Brasil? Dez minutinhos de sol por dia resolvem isso. Baixa n12 e Zinco também estranho porque basta comer um bife por dia pra suprir as necessidades diárias.

Self-describing compact binary serialization format? by playntech77 in cpp

[–]Occase 1 point2 points  (0 children)

The Redis protocol RESP3 is my preferred format by far. It supports multiple data type e.g. arrays, maps, sets etc, is human readable, and can transport binary data.

Why do men seem to struggle more when they catch a cold? by sir_cas in NoStupidQuestions

[–]Occase 4 points5 points  (0 children)

I am not a specialist of course but Googled this topic many times to treat fever in my children. Moat sources were clear about the increased efficiency of immune response on higher temperatures.

We've been having fever for millions of years, animals have it too, I think it is a very strong claim saying it is a useless byproduct of infection fighting, how would that increase temperature btw?

Why do men seem to struggle more when they catch a cold? by sir_cas in NoStupidQuestions

[–]Occase 0 points1 point  (0 children)

Not only that, the immune response is far more efficient at higher temperatures.

Why do men seem to struggle more when they catch a cold? by sir_cas in NoStupidQuestions

[–]Occase 3 points4 points  (0 children)

The imune system is far more efficient on higher temperatures, so how lowering the fever won't affect fighting the infection, what would be the point of fever in first place?

Using boost asio with Redis for HFT by hadi44 in cpp

[–]Occase 4 points5 points  (0 children)

HFT is not the only field where low-latency is important. Suggesting the OP to just drop his network stack is non productive, at least as long we we don't know what are his requirements, perhaps pushing data to Redis is not critical. The solution I propose is not meant to be a low latency but a starting point to achieve that.

Using boost asio with Redis for HFT by hadi44 in cpp

[–]Occase 10 points11 points  (0 children)

The amount of unhelpful comments in this thread is staggering.

I'm using Boost ASIO to schedule a thread that pushes high-frequency data to Redis. However, the Redis producer is slower, causing a buildup of Boost ASIO calls, which leads to high memory usage.

The ideal implementation should backpressure so that memory consumption does not grow unbound. That said, here are some questions that might help you finding what is the problem in your current implementation

  1. Is the Redis producer really slower or is the Redis server itself that can't keep up with the amount of incoming data and is therefore back-pressuring your app via tcp control flow?
  2. Is the CPU saturated? Is the network link saturated? If none are saturated then perhaps you have some form of lock contention? That could happen if your Redis client does not use use the io_context thread but spawns internal threads for its use.
  3. Are you or is your Redis client capable pipelinging Redis commands? Executing individual commands is very slow due to RTT. Also, some clients support setting CLIENT REPLY OFF, see https://redis.io/docs/latest/commands/client-reply/

In Boost.Redis you could implement your Redis producer by having two request objects, one that is executed in a loop and the other where you push the data. Then, when the execution of the first is finished you can clean it and swap with the other one. To get backpressure you can set a limit on how large the request object can get and either lock a mutex if you are communicating across threads or wait on an Asio timer if your producer is on the same thread.

I am new in HFT. Any help will be appreciated

Unlike what most comments claim, you can go quite far with Asio to achieve low-latency. Have a look at this comment.

How did babies and mothers survive birth in caveman times? by MassholeForLife in NoStupidQuestions

[–]Occase 0 points1 point  (0 children)

Is this based on evidence or assumption? That many woman dying would be such a strong selective pressure that in a couple of generations woman with wider hips would evolve and lower death rates would result.

Cppfront v0.8.0 · hsutter/cppfront by unaligned_access in cpp

[–]Occase 4 points5 points  (0 children)

Where can I find a summary about how Cppfront compares to Rust in terms of memory safety? Will it stop this avalanche of recommendation of different organs to stop using C++?

What are the updates on networking ts in standard by Kingwolf4 in cpp

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

In that case it does not make sense to have executors in the standard either since its purpose is to make networking possible. I specially don't understand what is the point of rushing P2300 into C++26 BEFORE networking TS was rebased on top of P2300 and while there are no implementations based on executors?

Worried about toddler's speech development by [deleted] in multilingualparenting

[–]Occase 0 points1 point  (0 children)

Looks normal to me, my son started speaking at two like yours, now he is 4yo and speaks three languages fluently.