2 ms·
> Vectorization is a huge subject in many different kinds of software, RDBMs, scientific computing A lot of which is written in C. C compilers have support for
by kazinator 3y ago
> Vectorization is a huge subject in many different kinds of software, RDBMs, scientific computing
A lot of which is written in C. C compilers have support for vector instructions.
Vector instructions can also be used via language extensions (that can look like a macro library and can be made to work without vectorization).
> C signals aren't a required part of the language.
ISO C defines signals, which are a required part of a hosted implementation; same as printf or malloc.
It is not a "full blown" signal specification like in POSIX. sigprocmask isn't in C, neither is sigsetjmp/siglongjmp.
> like processor interrupts?
Yes. Interrupt handling requires some processor-specific code to which the interrupt is vectored first; it does certain necessary things like save the machine state and acknowledge the interrupt. From that, C code can be dispatched. The meat of the interrupt handling is in C. Lots of systems are written on the "bare hardware" like that.
> this discussion is about language, not libraries.
Since I'm an actual Lisp person, I do not care about this difference.
"Language" is just the core special forms handled by an interpreter or compiler; library is everything else, including the run-time support needed by those special forms.
The "special forms" part of C brings little to the table in terms of concurrency other than the ability to write reentrant code. From that departure point, you can do a lot.
> There shouldn't have been a thing like "not required part of the language"
Interfaces and constructs that are described in a standard, but optional, still exist. There is a difference between that and not standardizing it at all.
Optional or not is mainly just a game of words: what can be implemented and what can be left out such that the implementation can still call itself "conforming".
If you make, say, threads required, then what it means is that C implementations for small systems will opt out of implementing that anyway, and just not be able to call themselves conforming.
Nothing changes; just the game of words and labels plays out differently.
> Everything short of stuff like HTML becomes a concurrent language
That is false. For instance Awk isn't a concurrent language. We can't write a re-entrant function in Awk that can be called safely at interrupt time.
Most of what defines a concurrent language is in the model of the run-time. For instance, the concurrency in Java actually comes from the JVM, and there are other languages on the JVM which borrow the concurrency model.
> Exactly the same is true for threads and atomics. A "standard compliant" implementation doesn't have to have them. Portable code shouldn't use this stuff.
If a program uses ISO C threads or atomic and needs to ported to some system/compiler where they are not available, it is likely possible to implement them in the program itself. I could probably knock it off in under a week.