data-race Questions

2

Solved

(Assume: int x{ 6 } and 2 evaluations write x = 6 at the same time) -- CPP reference says on Multi-threaded executions and data races | Data races: When an evaluation of an expression writes to a ...
Adagio asked 3/9, 2023 at 10:8

5

I often find these terms being used in context of concurrent programming . Are they the same thing or different ?

0

I'm running the MPMC example given in boost lockfree queue documentation with thread sanitizer and to my surprise this basic example contains data races as per TSan. Any idea what might be wrong? O...
Conservative asked 5/5, 2022 at 16:44

2

Solved

I was studying re-entrancy in programming. On this site of IBM (really good one). I have founded a code, copied below. It's the first code that comes rolling down the website. The code tries showi...
Harlequinade asked 16/1, 2020 at 17:4

2

Solved

Can multiple threads write the same value to the same variable at the same time safely? For a specific example — is the below code guaranteed by the C++ standard to compile, run without unde...
Jemina asked 9/1, 2020 at 1:11

5

Solved

This is a question about the formal guarantees of the C++ standard. The standard points out that the rules for std::memory_order_relaxed atomic variables allow "out of thin air" / "out of the blue...
Rearmost asked 19/6, 2019 at 18:41

3

Solved

I wrote a simple multithreading programs as follows: static bool finished = false; int func() { size_t i = 0; while (!finished) ++i; return i; } int main() { auto result=std::async(std::lau...

2

Solved

Consider this code, where x and y are integers: if (x) y = 42; Is the following compiler transformation allowed ? int tmp = y; y = 42; if (!x) y = tmp; context: This is from Bjarne Strous...
Teachin asked 25/8, 2017 at 15:42

1

Solved

I ran into a DATA RACE warning while testing my project, and was wondering if anyone would be kind enough to help me decipher the problem. I have never attempted testing go routines in the past and...
Moline asked 24/2, 2019 at 14:44

1

I have NetworkProvider which will make api call continuously and also once I received the data i will update the userid. At the same time I will access the userid from other functions. This is da...
Pickaback asked 25/9, 2017 at 21:42
1

© 2022 - 2024 — McMap. All rights reserved.