Discussion:
C compilers with at least C11 threads, atomics and membars?
(too old to reply)
Chris M. Thomasson
2024-08-04 23:28:45 UTC
Permalink
I know Pelles C does it, but any others?
Thiago Adams
2024-08-05 02:19:36 UTC
Permalink
Post by Chris M. Thomasson
I know Pelles C does it, but any others?
msvc
Chris M. Thomasson
2024-08-05 02:39:32 UTC
Permalink
Post by Chris M. Thomasson
I know Pelles C does it, but any others?
msvc
Does it have C11 threads, atomics and membars? Last time I checked it
did not.
Bonita Montero
2024-08-05 08:22:48 UTC
Permalink
Post by Chris M. Thomasson
Post by Chris M. Thomasson
I know Pelles C does it, but any others?
msvc
Does it have C11 threads, atomics and membars? Last time I checked it
did not.
Why bother with C when you can handle C++ ?
Blue-Maned_Hawk
2024-08-05 16:41:44 UTC
Permalink
Standard C threading and atomics are part of the standard library, not the
compiler. I don't know what you mean by the term ‘membars’, but if you
could define that, i might be able to answer.
--
Blue-Maned_Hawk│shortens to Hawk│/blu.mɛin.dʰak/│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
[machinery clunks in the background]
Scott Lurndal
2024-08-05 16:45:26 UTC
Permalink
Post by Blue-Maned_Hawk
Standard C threading and atomics are part of the standard library, not the
compiler. I don't know what you mean by the term ‘membars’, but if you
could define that, i might be able to answer.
They are referring to various forms of barrier instructions used
to synchronize memory accesses between independent processors.

I think you'll find that the compilers do have a role to play with respect
to standard C threading and atomics.
Blue-Maned_Hawk
2024-08-05 18:51:53 UTC
Permalink
Post by Blue-Maned_Hawk
Standard C threading and atomics are part of the standard library, not
the compiler. I don't know what you mean by the term ‘membars’, but if
you could define that, i might be able to answer.
They are referring to various forms of barrier instructions used to
synchronize memory accesses between independent processors.
I think you'll find that the compilers do have a role to play with
respect to standard C threading and atomics.
Standard C threading and atomics are accomplished through subroutines
defined in the standard library in headers that need not be supported by
freestanding implementations.
--
Blue-Maned_Hawk│shortens to Hawk│/blu.mɛin.dʰak/│he/him/his/himself/Mr.
blue-maned_hawk.srht.site
It is the best kind of possible: theoretically!
David Brown
2024-08-05 20:24:11 UTC
Permalink
Post by Blue-Maned_Hawk
Post by Blue-Maned_Hawk
Standard C threading and atomics are part of the standard library, not
the compiler. I don't know what you mean by the term ‘membars’, but if
you could define that, i might be able to answer.
They are referring to various forms of barrier instructions used to
synchronize memory accesses between independent processors.
I think you'll find that the compilers do have a role to play with
respect to standard C threading and atomics.
Standard C threading and atomics are accomplished through subroutines
defined in the standard library in headers that need not be supported by
freestanding implementations.
Atomics - including the _Atomic keyword - are discussed throughout the C
standards, not just in the standard library sections. Fences (aka
barriers) are also discussed long before the library part. It may be
that people use the standard library headers to access these features,
and they are optional in a given implementation, but they are very much
an integrated part of compilers and not merely functions declared in
headers.
Chris M. Thomasson
2024-08-05 20:30:45 UTC
Permalink
Post by Blue-Maned_Hawk
Post by Blue-Maned_Hawk
Standard C threading and atomics are part of the standard library, not
the compiler. I don't know what you mean by the term ‘membars’, but if
you could define that, i might be able to answer.
They are referring to various forms of barrier instructions used to
synchronize memory accesses between independent processors.
I think you'll find that the compilers do have a role to play with
respect to standard C threading and atomics.
Standard C threading and atomics are accomplished through subroutines
defined in the standard library in headers that need not be supported by
freestanding implementations.
You sound like the past, pre C11. Actually, the compiler plays a fairly
"major" role in in such things, indeed! Heck even pre C11 if a compiler
wanted to support POSIX it has to do certain things... This is why I had
to code the "sensitive" parts of my lock/wait free algorithms in pure
ASM. Aka, externally assembled libraries. Iirc, even then LTO could be a
potential problem way back then...

Loading...