Data Race Atomic Operations

조회 수: 6 (최근 30일)
Husnu umut Okur
Husnu umut Okur 2023년 1월 13일
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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by