I have heard that during meiosis, homologous chromosomes from each parent "cross-over", which enables the off-spring to inherit some alleles from the mother and some alleles from the father. The picture below illustrates this "cross-over", but of course this must occur at multiple sites, rather than just the one shown in the picture.
Now my question is what causes the chromosomes to align perfectly during cross-over so that the loci of a particular gene will substitute for the corresponding loci on the homologous chromosome, as opposed to being substituted with a completely random locus? Does each gene have a unique non coding sequence before it specifying what gene it is to enable this process to occur?