Threads accessing same buffer

Nov 25, 2020 at 4:26pm
I have a big buffer that I want to share between threads, each thread will always be reading from different parts of the buffer (never from the same part), so should i use different pointers with appropriate offset, or is this result in some error, or datarace.
Nov 25, 2020 at 4:54pm
If you can be absolutely certain that no to threads will be writing to the same bit of memory - i.e. the same elements of the array - then it should be safe giving each thread an offset so that it can write to its own exclusive bit of the array.
Last edited on Nov 25, 2020 at 4:54pm
Nov 25, 2020 at 5:23pm
Works OK with WIN32 APIs with Windows.
Nov 27, 2020 at 1:03pm
Thanks for clearing my doubts.
Topic archived. No new replies allowed.