The HDF5 global lock is not shared across separate processes on a single machine. Each process that opens an HDF5 file has its own instance of the HDF5 library and thus maintains its own separate global lock. This means that the lock only applies within a single process and does not affect other processes accessing the same file.
So did you mean actual processes on the same OS or hardware machine? Or did you mean processes in shared memory such as multiple threads?
You mention later needing to write to two files in the same process, which is completely different that the first specification.