In order to understand something about sex in fungi, we need to look at the general nuclear cycle of fungi. Comparing this to the life cycle of an animal or plant you'll notice some big differences. For the most part fungi are either haploid, with one set of chromosomes in a nucleus, or dikaryotic, with two sets of chromosome, each set in a separate nucleus. Most animals are diploid, with two sets of chromosomes in a single nucleus. You'll notice the three major steps in the life cycle of a fungus to the left are plasmogamy (joining of cytoplasm from two parents), karyogamy (fusion of the two parental nuclei) and meiosis (reduction division, returning to the haploid state.) In most fungi the diploid consists of only a single cell in the life cycle. There are four phyla of fungi, each of which is distinguished by its sexual reproductive structures and the amount of time spent in each of the phases. Notice that in animals and in plants we usually talk about plasmogamy and karyogamy as a single event called fertilization, since the two events occur in rapid succession. In fungi plasmogamy may be separated from karyogamy for several minutes up to several centuries! This means that in some fungi the dikaryon may be the most long-lived part of the life cycle.
It doesn't sound very romantic, but sex in fungi primarily involves getting the two parental nuclei into the same cytoplasm. Many fungi, like Schizophyllum, don't even have differentiated sex organs! Wherever they touch they can exchange nuclei. There are genetic controls over which individual a fungus may "choose" for its mate. Many of the more primitive fungi have only two sexes. In some cases we can distinguish male from female gametes or gametangia, but in most cases they are morphologically identical. In these cases we must call them + and -, or A and a, or 1 and 2. Thus any spore from one mating will be sexually compatible with half of its siblings or half of the population. The mating type is determined in this case by a single genetic locus with two alleles.
Some species of fungi (and probably some slime molds) have gone a step farther, having multiple alleles at this single locus. For example in a population, a fungus may have three alleles at a locus, designated A1, A2, and A3. Any given spore would still be compatible with half its siblings, but compatible with 2/3 of the population in general. This encourages a spore not to mate with its siblings, or encourages outbreeding in a population. These numbers would change as the number of alleles at that locus increases in the population.
Another advancement has taken place in some fungi-- using two genetic loci to determine mating type. These are designated as the A and B loci (pretty clever, those geneticists...). Let's assume for the sake of discussion that there are two alleles at each locus and let's assume that two haploids are coming together for a mating. (dim the lights please) We'll designate the first parental strain as A1B1 and the second as A2B2. As long as the mating types differ at both alleles, a mating can take place.
A1B1 X A2B2
Since the A and B loci are genetically unlinked (on different chromosomes), independent assortment takes place during meiosis, and the haploid offspring of this mating would have one of the following mating types.
A1B1, A2B2 and the new combinations A1B2 and A2B1.
Thus any of the offspring would be compatible with only 1/4 of its siblings, a significant improvement over the single locus system. In reality there are usually more than two alleles at any one locus. Each individual is compatible with any individual that is different at both loci. In Schizophyllum commune there are more than 300 alleles at the A locus and more than 90 known for the B locus. Thus there are more than 28,000 different combinations of A and B, or 28,000 different sexes! Each individual is compatible with 27,997 of the others in the worldwide population (99.98% outbreeding) compared with being compatible with only 1/4 of its siblings. Thus the enormous number of sexes in fungi is meant to encourage non-sibling mating and non-relative mating, which ensures genetic diversity in the population.