It helps maintain the consistency of data by using variables or hardware software that only one process can make changes to the shared memory at a time.