source:
CIVL/mods/dev.civl.abc/examples/omp/raceCond1.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 239 bytes | |
| Rev | Line | |
|---|---|---|
| [f2097b0] | 1 | // a progrm with race condition |
| 2 | // online source: http://sourceforge.net/apps/trac/cppcheck/ticket/663 | |
| 3 | ||
| 4 | #include <omp.h> | |
| 5 | int main() | |
| 6 | { | |
| 7 | int a[50],i; | |
| 8 | ||
| 9 | a[0] = 1; | |
| 10 | #pragma omp parallel for | |
| 11 | for(i=1; i<50; i++) | |
| 12 | { | |
| 13 | a[i] = i + a[i-1]; | |
| 14 | } | |
| 15 | } |
Note:
See TracBrowser
for help on using the repository browser.
