Many readers and several writers: how to manage them?

I’m reading to arbitrate read and write access to the set of files.

There will be several processes reading files and one~two processes writing to the same files.

Please give a hint - how do they know the names of the locks?
Do I initialize something prior to starting those processes and by that I create lock’s names to use in readers and writers?