Skip to content

Data racing issue with heavy load #3

@QianYizhou

Description

@QianYizhou

Hi,
Your SPMC_Queue is really inspiring! But it seems there's still a data racing issue.

My test steps:

  1. in multhread.cc, extend array size defined in struct Msg to make it heavier, e.g.,
    struct Msg
    {
    uint64_t tsc;
    uint64_t i[1];
    };
    to
    struct Msg
    {
    uint64_t tsc;
    uint64_t i[100];
    double f[100];
    };
  2. compare Msg.f as well
  3. Loop more times (1e6 -> 1e7)

Then these's a possibility of assert fault.
I think it may related to the write() operation: sees that operation does't care if the data is occupied by a reader -- the data may be changed by write() while reader is reading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions