tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH 3/3] stdatomic: stdatomic.h header


From: Kyryl Melekhin
Subject: Re: [Tinycc-devel] [PATCH 3/3] stdatomic: stdatomic.h header
Date: Tue, 26 Jan 2021 22:54:31 +0000
User-agent: Heirloom mailx 12.4 7/29/08

Elijah Stone <elronnd@elronnd.net> wrote:

> On Tue, 26 Jan 2021, Kyryl Melekhin wrote:
>
> > Also while atomics are probably better solution so using something like 
> > mutex or spinlock, they are platform dependant
>
> They're no more platform-dependent than addition.  Obviously they do need 
> support from the CPU, but so does everything else.  They don't depend on 
> any OS-specific facilities or anything like that.
>
> > they just kind of produce code smell
>
> How's that?

Absolutely agree with you that atomics are nothing more but just cpu
instructions. I probably think this way because I always try to not use
any GNU compiler extensions or anything too fancy that would require use
of extra features. So for example just calling pthread_mutex_lock() does
not require anything from compiler other than to call the function.
I think part of contributing to this midset is that I only write C99
code, and tcc being not able to support atomics until now assured me
not to use them. It's hard to accept some feature like this one after
avoiding it for very long time. I might come to change my mind.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]