Māhābhārata Describes Bhagavana Shiva meeting with Sri Krishna after the Latter appeased him with a long Penance after getting Pāsupata Diksa from Rishi Upamanyu.
Māhābhārata, Anusāsana Parva, Ch 14 (Gitapress)
The following chapter describes how Sri Krishna was Granted several Boons by Māhādeva and Pārvati including the boons of 10,000 sons and 16,000 wives.
The blessed Krishna said, 'Bowing my head with great joy unto that
mass of energy and effulgence, I said these words unto the great
Deity, with a heart filled with gladness,--Firmness in virtue, the
slaughter of foes in battle, the highest fame, the greatest might,
devotion to Yoga, thy adjacence, and hundreds upon hundreds of
children, these are the boons I solicit of thee,--So be it,--said
Sankara repeating the words I had uttered. After this, the mother of
the universe, the upholders of all things, who cleanses, all things,
viz., the spouse of Sarva, that vast receptacle of penances said with
a restrained soul these words unto me,--'The puissant Mahadeva has
granted thee, O sinless one, a son who shall be named Samva. Do thou
take from me also eight boons which thou choosest. I shall certainly
grant them to thee.--Bowing unto her with a bend of my head, I said
unto her, O son of Pandu,--I solicit from thee non-anger against the
Brahmanas, grace of my father, a hundred sons, the highest enjoyments,
love for my family, the grace of my mother, the attainment of
tranquillity and peace, and cleverness in every act!'
"Uma said, 'It shall be even so, O thou that art possessed of prowess
and puissance equal to that of a celestial. I never say what is
untrue. Thou shalt have sixteen thousand wives. Thy love for them and
theirs also for thee shall be unlimited. From all thy kinsmen also,
thou shalt receive the highest affection. Thy body too shall be most
beautiful. Seven thousand guests will daily feed at thy palace.'
The Above Anecdote is also recorded in several Purānas such as Siva purāna, Linga Purana, Kurma purana, Devi Bhagavata etc with a few variations.
One can read the english translation of the above anecdote from Kesari mohan Ganguly's translation which is provided below-