If “Thanks for Sharing” feels, at times, like a feature-length advertisement for sex-addiction recovery groups, you can hardly blame it. Unlike alcohol, drugs and gambling, addiction to sex is still viewed by some as a glamorous folly, the stuff of attention-craving starlets and philanderers looking to justify their cravings. Certainly, “Thanks for Sharing” is an endorsement of 12-step treatment plan for sex addiction, but it serves a more important function as a serious primer on the disease and its various habits, triggers and manifestations. If you’re one of the skeptics who doesn’t consider sex a legitimate addiction, this thoughtful, funny and moving advocacy film will probably change your mind.

The three main characters satisfy distinct recovery archetypes: There’s Tim Robbins as Mike, a recovering addict since forever who is married and who deals with his disease through New Age spirituality; Mark Ruffalo as Adam, a five-years-sober sex addict trying to build a monogamous relationship with Gwyneth Paltrow’s Phoebe, who carries her own addictive baggage; and Josh Gad’s Neil, a young doctor whose addiction has resulted in criminal behavior and court-ordered treatment.

“Thanks for Sharing” is largely a comedy, but it’s a powerfully realistic one that pulls no punches. There are scenes involving group commiseration, painful revelations and disturbing relapses. Stuart Blumberg, the film’s first-time writer and director, captures both the universality of all addiction and the specificity of this particular one, which unlike many others is grounded in healthy human need. As Mike says to his group, “It’s like trying to quit crack while the pipe is attached to your body.” There’s wisdom in lines like these, and there are many of them in “Thanks for Sharing.”

If there’s a problem with the movie, it’s that it lives in a cloistered universe where everybody is an addict – even the ancillary characters are walking, talking cautionary tales endorsing and condemning certain forms of addiction. I could have done without the rote and requisite conflict between Mike and his wayward, substance-abuse-addicted son Danny (Patrick Fugit), though even this subplot resolves itself in a manner that is surprisingly effective on an emotional level.

It works, ultimately, because Blumberg invests everyone with relatable pathos. Whether it’s the familiar hard stuff or less-publicized vices like shopping, chocolate and weightlifting, most of us have at least one vice, and it’s natural to root for transcendence. Everybody here is human, with manifold flaws, and we care deeply about their wellbeing. We genuinely want them to succeed, which, in today’s Hollywood, is a pretty rare accomplishment.

"Thanks for Sharing" opens today at most South Florida theaters.