Link Copied
Thank you for your time and comments on this subject.
I see how the approach you explain above would make data races a non issue, since you are not reusing any memory but creating it as needed and deleting after it had been used. I had assumed that reusing a buffer that is created at the beginning of process, would be faster than creating and deleting memory during the process. by reusing the memory it does cause data race conditions.
I now plan to take a step back in my design and investigate which of these approaches are better for what I am trying to accomplish.
For more complete information about compiler optimizations, see our Optimization Notice.