It's 2006. I'm working with threads in C and it's awful
-
@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
-
@eniko you could leave "in C" out and it would be about the same
@joe but threads in C are worse than any other language
-
It's 2006. I'm working with threads in C and it's awful
It's 2016. I'm working with threads in C and it's awful
It's 2026. I'm working with threads in C and it's awful
"Oh well threads are bad in <other language> too"
No you don't understand. Working with threads in C doesn't really actually work and if you do get it to work it's still so much fucking worse than working with threads in any other language
-
@silvermoon82 and the w is for works well in windows
@eniko
Oof, *windows* threads in C! Fun fun! -
@eniko
Oof, *windows* threads in C! Fun fun!@silvermoon82 well wtf good is writing something in C if it's not maximally portable :/
-
"Oh well threads are bad in <other language> too"
No you don't understand. Working with threads in C doesn't really actually work and if you do get it to work it's still so much fucking worse than working with threads in any other language
Like, I'm *good* at avoiding the pitfalls of threads. Normally. In any other language that *isn't* C
-
Like, I'm *good* at avoiding the pitfalls of threads. Normally. In any other language that *isn't* C
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*?
-
It's 2006. I'm working with threads in C and it's awful
It's 2016. I'm working with threads in C and it's awful
It's 2026. I'm working with threads in C and it's awful
@eniko Consistency is nice I guess? -
@khleedril @eniko
Are they though?
Threads have a lot more problems than memory issues
-
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*?
"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!!!
-
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 IIUC you can declare a C-compiler C11 compatible but not have support for the concurrency API, in which case the compiler defines __STDC_NO_THREADS__ and you can't include threads.h
-
@eniko IIUC you can declare a C-compiler C11 compatible but not have support for the concurrency API, in which case the compiler defines __STDC_NO_THREADS__ and you can't include threads.h
@gabrielesvelto that sounds like threads in C alright
-
@eniko IIUC you can declare a C-compiler C11 compatible but not have support for the concurrency API, in which case the compiler defines __STDC_NO_THREADS__ and you can't include threads.h
@gabrielesvelto @eniko
Why am I totally unsurprised.
Appalled yes, but unsurprised. -
It's 2006. I'm working with threads in C and it's awful
It's 2016. I'm working with threads in C and it's awful
It's 2026. I'm working with threads in C and it's awful
@eniko i have an easier time working with multiprocess than multithreading. that should tell you everything
-
"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 also switching to linux isn't going to make compiling for windows any less miserable
threads.h will still be broken
-
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 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.)
-
@eniko also switching to linux isn't going to make compiling for windows any less miserable
threads.h will still be broken
@clarfonthey and if you're making a single header library it still has to compile on msvc
-
@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