Proof of value discovery in complete graphs I have an assignment


There are n > 2 finite processors, two registers for each processor.
Register s_i is not readable by the processor p_i but any other processor can read it.
Register r_i is readable and writable by the processor p_i and any other processor can read it.


I have to solve the problem to let p_i discover the secret s_i value by reading r_i value. I don't have to (probably) come up with something super-scientific a somewhat simple proof will do just fine. I've been reading through various publications (leader election, complete graphs, uniform, etc) but wasn't able to find a point to start from.
If I understand correctly, a rough approach could be as follows.

Each processor $p_i$ can read $s_{i+1\ {\sf mod}\ n}$ and write its content to $r_i$.

Then each processor $p_i$ can read the wanted value by reading $r_{i-1\ {\sf mod}\ n}$.

The main issue of this naive algorithm is that some synchronization is needed between the two steps: $p_i$ must not read $r_{i-1\ {\sf mod}\ n}$ too soon, before it is written by $p_{i-1\ {\sf mod}\ n}$.