PRAM Model
This is a widely used theoretical model for parallel machines, which is made of processors with uniform access to a large shared memory. It is a tightly coupled machine, that is capable of giving each processor a different, unrelated task. Each processor takes the same amount of time to fetch from memory, preform an operation, and write back to memory. This results in a synchronized machine, which eliminates the problem of a processor trying to write to memory while another processor is reading from memory. It does still have the possibility of two or more processors trying to read or write to the same memory cell at the same time. There are four different ways to solve this problem, using concurrent or exclusive reading and writing to memory.
Exclusive read and exclusive write (EREW) only allows one processor access to read and write to memory. The processor that succeeds can be determined by a priority model, which gives each processor a priority, and the processor with the higher priority will get access to memory, and the other will result in an error.
Exclusive read and concurrent write (ERCW) allows processors to write to memory at the same time, but if more than one processor tries to read from the same spot, it will not be allowed. The concurrent write can be handled by allowing the processors to both write to memory at the same time if they are writing the same value. It could also be handled by combining the two values in some way (summing, finding the largest, etc.).
Concurrent read and exclusive write (CREW) allows processors to read from memory at the same time, but only one can write to memory at a time. This can be handled the same way as EREW handles exclusive writing. This is the most common way to handle this problem because reading from memory at the same time as another processor will not effect the program in any way, but writing to memory at the same time could.
Concurrent read and concurrent write (CRCW) allows processors to read and write to memory at the same time. The write to memory could be handled the same way as it is handled in ERCW.
Each of these solutions could be helpful for a program depending on what you want to do.
Exclusive read and exclusive write (EREW) only allows one processor access to read and write to memory. The processor that succeeds can be determined by a priority model, which gives each processor a priority, and the processor with the higher priority will get access to memory, and the other will result in an error.
Exclusive read and concurrent write (ERCW) allows processors to write to memory at the same time, but if more than one processor tries to read from the same spot, it will not be allowed. The concurrent write can be handled by allowing the processors to both write to memory at the same time if they are writing the same value. It could also be handled by combining the two values in some way (summing, finding the largest, etc.).
Concurrent read and exclusive write (CREW) allows processors to read from memory at the same time, but only one can write to memory at a time. This can be handled the same way as EREW handles exclusive writing. This is the most common way to handle this problem because reading from memory at the same time as another processor will not effect the program in any way, but writing to memory at the same time could.
Concurrent read and concurrent write (CRCW) allows processors to read and write to memory at the same time. The write to memory could be handled the same way as it is handled in ERCW.
Each of these solutions could be helpful for a program depending on what you want to do.