Data Race Atomic Operations

4 visualizzazioni (ultimi 30 giorni)
Husnu umut Okur
Husnu umut Okur il 13 Gen 2023
Hello,
I want to understand if data race condition is a bug in atomic operations.
Because: When using atomic operations, if "Data Race including atomic operations" is selected under Concurrency in the Bug Finder Analysis section, 'Data race ' error comes and Critical Protection is recommended to prevent it. should i follow it ?
Polyspace uses the Pointer size for your Target processor type as the threshold to compute atomicity.
If 'Data Race including atomic operations' is selected, analysis shows the error on var else it does not show. Ist it important the select this defect ?
int var;
void begin_critical_section(void);
void end_critical_section(void);
void increment(void) {
var++;
}
void task1(void) {
increment();
}
void task2(void) {
increment();
}
void task3(void) {
begin_critical_section();
increment();
end_critical_section();
}
you can see the example from the link

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by