-
Notifications
You must be signed in to change notification settings - Fork 889
Closed
Labels
bugSomething isn't workingSomething isn't workinghardwareNew hardware or architecture support requestNew hardware or architecture support request
Description
char my_array[10];Let's say threadA changes the value of my_array[0] and threadB changes the value of my_array[1] , is this thread safe?
My instinct tells me that it is not thread-safe, because since arrays cannot have padding bytes between elements, and usually CPU access (read/write) multiple bytes at a time, that means changing the value of my_array[0] would result in writing adjacent array elements which may have changed in the meantime.
More specifically, is this guaranteed to be thread-safe with single core MCUs without cache?
And if this is thread-safe, is this guaranteed by the CPU or by ThreadX?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghardwareNew hardware or architecture support requestNew hardware or architecture support request