Problem:

One thread is writing a variable 'count' and 20 threads have to read this variable within a time frame of 30 milli seconds.
The writer thread should write the new value of 'count' in the next cycle, only after the 20 reader threads have read the current value of 'count' in the current cycle of 30 milliseconds.
The same for reader threads too. Reader threads have to read the new value of 'count' in the current cycle only after the writer thread has updated the previous value of 'count' in the current cycle.

Current situation:

The writer thread is updating the variable 'count' in current cycle. Before all 20 reader threads read the value of 'count' in this cycle, writer thread updates the value of 'count' and hence the remaining reader threads are reading the wrong value missing out the correct value.

(1) How to synchronize these threads in the following serial way -

1 writer thread writes the variable 'count', then 20 reader threads read it, then again 1 writer thread writes, then 20 reader threads read ?

The reader threads count is not fixed to 20. Sometimes there may be only 5 reader threads, sometimes there may be 15.

(2) Which synchronization object to use and how ? All threads are in the same application.