logoalt Hacker News

grg0today at 1:28 AM1 replyview on HN

What do you mean you didn't notice? I saw another comment about Claude below, are you not even reviewing the output?

I just browsed the project for two minutes and it's one of the first things I noticed. std::thread is more portable (Windows, if anyone cares) and allows you to pass in a lambda, which keeps the code local and also has the compiler generate the closure for you instead of having to pass function pointers and void* captures around. I don't see any advantage to using pthread directly.


Replies

pg83today at 1:44 AM

> What do you mean you didn't notice? I saw another comment about Claude below, are you not even reviewing the output?

Of course I looked at the LLM output, but people, uh, make mistakes and can miss something.

> std::thread is more portable (Windows, if anyone cares) and allows you to pass in a lambda, which keeps the code local and also has the compiler generate the closure for you instead of having to pass function pointers and void* captures around. I don't see any advantage to using pthread directly.

These are obvious things, and the objections to them are equally obvious. For example, std::thread is an additional level of abstraction over pthreads, which, in essence (not in form), gives me nothing. And I don't care about Windows, really.