SPMC_Queue
SPMC_Queue copied to clipboard
Data racing issue with heavy load
Hi, Your SPMC_Queue is really inspiring! But it seems there's still a data racing issue.
My test steps:
- 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]; };
- compare Msg.f as well
- 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.