|
From: John R. <jr...@bi...> - 2011-05-15 21:24:37
|
> Not sure what you mean however. The characters in the original message were * global_array[0] *= value1; * global_array[1] *= value2; except there were no spaces and no semicolons. This is unclear. Why the leading star '*' before "global_array"? My mail reader interpreted this in "Simple HTML" as asking for bold font with straight assignment (no "multiply in place"), as if the HTML markup: <b>global_array[0]</b> = value1; <b>global_array[1]</b> = value2; As such, there are no fetch operations, therefore no races. If helgrind complains, then that is a bug in helgrind. > If Thread1 did a read(global_array[0]) and Thread2 did a write(global_array[1]), then there is still no race. Again, this is unclear. Do you intend those two operations to be a new separate example, or do you intend to append those operations to the original scenario? Please write (in C code as text, not HTML) the complete, exact code that you mean. If those two operations are a separate, complete scenario, then Yes, there still is no race. A race requires a write and a read of the same location. The locations of the write and the read differ, so there can be no race. If helgrind complains, then that is a bug in helgrind. -- |