Mark Ruffalo, left, and Gwyneth Paltrow star in “Thanks for Sharing,” a romantic comedy about the dangers of sex addiction.

“Thanks for Sharing,” starring Mark Ruffalo, Gwyneth Paltrow and Tim Robbins, uses the rom-com format to explore a serious subject — addiction. Co-writer and first-time director Stuart Blumberg displays a deft touch with comedy, but the film, out Friday, also depicts just how quickly addictions can destroy lives and re-emerge in those who seem to have their demons beaten.

What made you write a romantic comedy about something that’s usually taken very seriously?
You always need an obstacle when you’re writing, whether it’s a romantic film or a comedy or a dramedy. I think that addiction provides a very strong obstacle. It was something I had been toying with for years, and I felt like it was an idea whose time had come.

Why are so many characters dealing with multiple addictions?
That was something I noticed going to these meetings [for research]. There were a lot of people in multiple programs — half the people in sex addiction meetings were in AA. They call it “whack-a-mole” — you knock down one thing, another thing comes out.

Gwyneth Paltrow’s character is into working out and it’s hinted that she has control issues when it comes to healthy eating, but she’s not in any program. How does that character function in the larger story?
There are certain behaviors that are lauded as impressive, even though they might be harmful. Someone might not drink, but they work so much they haven’t seen their family and friends in weeks, but it’s OK because that’s workaholism. Society privileges some behaviors and stigmatizes others.

Mark Ruffalo’s character can get a ton of women, which doesn’t seem all that bad and isn’t illegal, but the way Josh Gad’s character acts out, rubbing up against women in the subway and filming up their skirts, is really creepy.
I did want to show that [addiction] can be very lonely, but there’s a part of it that’s really fun. It’s fun and awesome until it’s horrible. Just to say all this behavior is horrible doesn’t capture the truth of it.