It's 2006. I'm working with threads in C and it's awful
-
@eniko Huh, TIL C99 has been superseded!
(My familiarity with C is just enough to be able to write patches for established software, but I can't write it from scratch.)
@ryan that's cause nobody feels ready to use anything past C99 yet... for many reasons
-
"Oh well if you're writing C you should be running Linu-"
I am not going to switch operating systems just to make it 5% less miserable to work with threads in C!!!
@eniko I don't know about the compile errors, but I recently learned about conditional variables in C++, which have made my muli-threading life much easier, just being able to wait for a condition before continuing. I also really like recursive_ mutex, lets you lock multiple times on one thread so locking functions can call other locking functions without worrying about a thread deadlocking itself.
-
Oh what's that? C11 standardized threads.h? OK well the api looks pretty trash but I guess anything's better than pthreads. Let me just open VS2022, msvc, ok... #include <threads.h>
....... why are there like two dozen compiler errors *in the damn header*?
@eniko this sounds like msvc, its such a pain haha
llvm on windows has gotten a lot better over the past few years, but that may not be an option for your circumstance
-
Oh what's that? C11 standardized threads.h? OK well the api looks pretty trash but I guess anything's better than pthreads. Let me just open VS2022, msvc, ok... #include <threads.h>
....... why are there like two dozen compiler errors *in the damn header*?
@eniko It’s optional and many don’t implement it
-
@pixx it's just as bad as working with threads in any other language but there's no functional standard and the api is worse
> no functional standard
Yeaaaaah
libthread is great but then i venture out into the real world and it's gone :(
-
"Oh well if you're writing C you should be running Linu-"
I am not going to switch operating systems just to make it 5% less miserable to work with threads in C!!!
@eniko tbf working with C in 2026 sounds awful even on Linux. The only real benefit seems to be setup is less of a headache in general for working with any language on Linux
I say this as someone who primarily does shit in C in 2026
-
@eniko Have you heard the good news about our lord and savior Rust yet?
@superblox
@eniko
Half shitpost/half earnestpost:
But what about in Zig? -
@eniko Sorry to use the R-word, but... Rust?
@khleedril @eniko "now you have two problems" 🤣
-
"Oh well if you're writing C you should be running Linu-"
I am not going to switch operating systems just to make it 5% less miserable to work with threads in C!!!
@eniko how's Clang in Windows these days? MSVC is notoriously bad (and obsolete) C-wise
-
@eniko how's Clang in Windows these days? MSVC is notoriously bad (and obsolete) C-wise
-
woohoo 8-/