Atomic Types in C language

Asked

Viewed 72 times

5

What is the difference between primitive and atomic type ?

What are atomic types for ?

In which situations they are applied ?

  • 1

    Is that what you’re talking about? https://en.cppreference.com/w/c/language/atomic

  • Yes, that’s exactly it.

  • 1

    I don’t know, they’re concepts so different that I don’t even know where to start :)

1 answer

1


There’s a big difference between types primitive and types atomic.

Atomic types are free of data breeds and can be modified and/or accessed by two different threads. An atomic data is widely used when, for example, we have 2 different actions that are performed in this data, such as reading and writing, this data type is also widely used in operating systems, where it is necessary that a data is accessed by different threads.

It is wrong to say this, but it would be something close to an asynchronous operation.

  • 1

    What would be a race of data? :)

  • What would be race of data ?

  • 1

    Data race would be a way of saying "data types" - int, float, etc...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.