Calculating the odds of a television program winning a series Emmy five years running is an exercise best left to a mathematician. “Frasier” pulled off that feat from 1994 to 1998, and show runner Christopher Lloyd remembers thoroughly enjoying the streak — and, because he is “snarly” and “competitive,” not taking kindly to “Ally McBeal” ending it. He knew it would never happen again.

Except, this year “Modern Family,” the warm, funny, relatable comedy Lloyd created with Steve Levitan, just repeated the accomplishment. “Modern Family” had won the comedy series Emmy for the last four years, and even with strong competition from the likes of “Louie” and newcomer “Orange Is the New Black,” it prevailed again this year, raising Lloyd’s record total of Emmys as a producer to 10.

Television excellence runs in the family. Lloyd’s father, David, was one of the most celebrated writers in the medium, the author of dozens of superb episodes of classic sitcoms like “The Mary Tyler Moore Show,” “Taxi” and “Cheers.” David Lloyd wrote “Chuckles Bites the Dust,” the landmark 1975 “Mary Tyler Moore” episode often cited as the greatest half-hour in television history. The younger Lloyd, then 15, sat in the front row of the CBS Studio Center bleachers when that episode filmed. He often went to the set with his dad, though he rarely ventured beyond his assigned seat in the studio audience. (“We were a nervous, rule-following Catholic family,” Lloyd says.)

Family ties have always been a central part of Lloyd’s work. He’s mining them on “Modern Family” with his younger brother, Stephen, a television veteran who joined the writing staff this year after his own show, “How I Met Your Mother,” ended. Lloyd jokes that he and Levitan encourage the “Modern Family” staff to devote as much time as possible with their own broods during weekends and the off-season, “embarrassing each other and utterly shaming themselves publicly so we have something to write about next year.”

Lloyd’s own contributions come from his 19-year marriage to Arleen Sorkin (no relation to Aaron) and the time spent raising two sons, both now teenagers, tall young men able to school him on the basketball court behind the house. Echoes of his family life can be seen throughout the various “Modern Family” clans but most directly within the relationship between mild-mannered Mitchell and the flamboyant Cameron.

“Arleen loves a party,” says Jesse Tyler Ferguson, who plays Mitchell on the show. “Chris is very even-keeled. He doesn’t waste breaths. Every sentence that comes out of his mouth has a purpose.”

Lloyd recalls sometimes coming home after work, hoping to unwind quietly and maybe watch a little “Monday Night Football,” only to find valet parkers in front of the house for reasons unknown.

“A guy’s handing me a ticket and I’m staring through the drapes trying to figure out what’s going on and what cause it’s for,” Lloyd says of the mystery event at home. “So, yes, she’s the Cam. It’s hard for her to say no to anyone with a sad story. I’m the sort of closed-off, let’s-bar-the-doors character like Mitchell. And I’m aware, having grown up in that kind of household, that it’s not always good to bar the door. It’s good to have the chaotic world swirl through your house once in awhile. And it’s good for our kids. They get a mix.”