hi,
I am new to thread mechanism so it may seem somewhat awkward.The scenario i am in is i want to fetch user input from main thread and simultaneously i want to run other threads in background.How do i achieve it.
Thanks.
Kushal
class CParent;
class CUserInput : public KThreadProcessor
{
public:
void Process()
{
// obtain user input in this method which runs in own thread
// use your locally set members (m_pParent or whatever else)
// to issue a thread from a pool to handle user input ...
m_pParent->ProcessUserInput(ui);
}
private:
CParent * m_pParent;
....
};
class CParent
{
public:
void ProcessUserInput(UserInput ui)
{
// call for a free thread from the thread pool and process the user input
}
private:
KThreadPool * m_pThreadPool;
};