Skip to content

Which one does the last code in 8.1. Races cause, a data race or a race condition? #466

@shinmili

Description

@shinmili

The comment in the last code in 8.1. Races says "This is a race condition", but the description right above says "We can cause a data race". Which one is correct?

I guess it doesn't cause a data race, because all of the accesses to the AtomicUsize are synchronized, so the third requirement of a data race "one or more of them is unsynchronized" is not met.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions