I'd like to suggest you take a look at
POE, a single threaded event-driven framework, (almost)perfect for your kind of problem. The reason I say "almost" is that I haven't been able to figure out how to do publish/subscribe with it, its default is to raise an event, and register one handle. I'm sure it's doable. But it certainly solves your thread-sharing problem.