In Europe, it's common practice to use the kernels of the stone fruit, known as noyaux (pronounced nwa-yo), in a variety of culinary uses, such as in an apricot jam. These kernels have a distinctly nutty flavor, reminiscent of almonds.
This is not a coincidence.
Almonds are actually closely related to stone fruit; they are all drupes in the prunus genus. In fact, if you've ever seen a green almond, with the pulp still intact, it looks very much like a small apricot. Conversely, these noyaux in stone fruit, particularly in peaches, strongly resemble almonds.
Noyaux are used not only in preserves, but in confections like the Italian cookies Amaretti di Saronno; almond-flavored liqueurs such as ratafia, Amaretto and Crème de Noyaux; and ice cream. They lend a pronounced almond flavor with a characteristic bitter edge at the finish. In fact, apricot kernels are used to make almond extract, not almonds.
However, they should not be used carelessly. Noyaux have varying amounts of the compound amygdalin, which derives its name from the ancient Greek word for almond. When it comes in contact with water, amygdalin hydrolyzes to become Prussic acid.
In other words, cyanide. Cyanide is a serious toxin; it blocks red blood cells' ability to carry oxygen, causing asphyxiation.
Still, you'd have to consume a pretty substantial amount of the kernels to suffer any ill effects, as the body is capable of neutralizing cyanide in small amounts. Though the amounts of amygdalin vary from fruit to fruit, it's estimated that a person weighing 150 pounds could eat up to a kilogram (2.2 pounds) of peach pits before hitting lethal levels of cyanide.
In small doses, though, amygdalin can be beneficial, and is used as a cough suppressant, decongestant, and laxative. Apricot seeds have been used in traditional Chinese medicine. For a while, amygdalin was synthesized into a compound called laetrile, which was touted as an alternative cancer treatment, but this was ultimately debunked.
If you want to get the flavor from noyaux but are concerned with the quantity of amygdalin, roast the whole pits in a 350°F oven for 10-15 minutes. This helps neutralize the amygdalin, and also makes the shells of the pits more brittle, which makes them easier to crack to get the kernels within. If desired, roast the noyaux an additional 10 minutes to thoroughly remove the amygdalin.
Many traditional recipes call for adding the whole noyaux to the preserves. I prefer to keep them in a cheesecloth sachet to remove before canning. Alternatively, they can be briefly steeped into a spirit, like bourbon, which is then added to the preserves.