Passing data between threads.

I have a main thread and a worker thread.

How do i pass data between them when both are already running
without using global variables?

publish and notify, push on a thread-safe queue, there are plenty of means to communicate. Details depend on what framework are you using (pthreads, std::thread, TBB, boost.asio), what you're familiar with, expected usage patterns, etc.
Topic archived. No new replies allowed.