I'm in the design phase of development and am considering using multi-threading in C++ to implement some functionality. I'm familiar with the basics of multi-threading but wanted to get others take on my idea. I haven't chosen a multi-threading library yet (leaning towards Boost) but my question is probably independent of the library chosen.
Basically I would have a class (let's call it CommandGenerator) that executes in a while loop (until terminated) and checks a message queue of commands that is populated by another piece of software. Every time CommandGenerator gets a message off the queue, I'd like it to spawn a thread that executes in the background and works with the data just pulled off the queue. Meanwhile I want CommandGenerator to continue to run and come around the while loop again and pull any new messages and again spawn more threads. Is this conceptually possible? Can I keep spawning threads and just let them run in the background until they complete while the code continues to loop and check the queue? CommandGenerator will not need to have control over the threads. They would be able to execute independently once created and are guaranteed to terminate but may take up to a minute to finish executing (they wait a certain amount of time specified in the message pulled off the queue before executing).
Any input is appreciated.
threadingmodule.<thread>header.