diff betwn child and worker thread?
-
what is the difference between Child thread Worker thread How do we create both threads /?? Vikas Amin Embin Technology Bombay
-
what is the difference between Child thread Worker thread How do we create both threads /?? Vikas Amin Embin Technology Bombay
Conceptually, in MFC we got two type of threads:- UI threads and worker threads. Have a look at AfxBeginThread(...) documentation. Vipin - MVP
-
Conceptually, in MFC we got two type of threads:- UI threads and worker threads. Have a look at AfxBeginThread(...) documentation. Vipin - MVP
Vipin Aravind wrote:
Conceptually, in MFC we got two type of threads:- UI threads and worker threads.
Specifically, however, they are thread with message pump, and thread without message pump.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
Vipin Aravind wrote:
Conceptually, in MFC we got two type of threads:- UI threads and worker threads.
Specifically, however, they are thread with message pump, and thread without message pump.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
david, can you explain it a little more? you mean UI->with msg pump and worker without Msg pmup?:~
VuNic
one thread (with the message pump ) receives messages from Windows, the other not.
Maximilien Lincourt Your Head A Splode - Strong Bad
-
david, can you explain it a little more? you mean UI->with msg pump and worker without Msg pmup?:~
VuNic
A "worker thread" can do some UI stuff (e.g.,
PostMessage()
and an occasionalSendMessage()
), and a "UI thread" can do worker stuff, so the terms are mostly meaningless.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
what is the difference between Child thread Worker thread How do we create both threads /?? Vikas Amin Embin Technology Bombay
vikas, What are you working on? I have noticed that you have been posting very basic questions. one or two is fine, but you have posted many of them. The questions you ask are generally asked my collage students, we can understand about them but you are a working professional working in Embin Technology. You should really buy a good book and read it nicely and read it again so that you get good knowledge w.r.t windows development. Take this as an advice, it will help you in your development career too. coming to ur question, Worker thread is (generally) a child thread of a process. Windows actually has the concept of UI Thread (contains windows message queue and a message pump) and worker thread does not have a message queue. Threads can be created using CreateThread(...) api, All threads that are created are always created as a worker thread i.e. no message queue, whenever someone posts a message to the thread or the thread creates a window, etc (anything that requires the thread to have a message queue) the message queue is created for the worker thread so effectivly the worker thread is now a UI Thread. why windows does this? Well the reason is very basic, to save memory, a worker thread which does not deal with any windows message do not need a message queue and so the memory is saved for the thread.
-Prakash
-
vikas, What are you working on? I have noticed that you have been posting very basic questions. one or two is fine, but you have posted many of them. The questions you ask are generally asked my collage students, we can understand about them but you are a working professional working in Embin Technology. You should really buy a good book and read it nicely and read it again so that you get good knowledge w.r.t windows development. Take this as an advice, it will help you in your development career too. coming to ur question, Worker thread is (generally) a child thread of a process. Windows actually has the concept of UI Thread (contains windows message queue and a message pump) and worker thread does not have a message queue. Threads can be created using CreateThread(...) api, All threads that are created are always created as a worker thread i.e. no message queue, whenever someone posts a message to the thread or the thread creates a window, etc (anything that requires the thread to have a message queue) the message queue is created for the worker thread so effectivly the worker thread is now a UI Thread. why windows does this? Well the reason is very basic, to save memory, a worker thread which does not deal with any windows message do not need a message queue and so the memory is saved for the thread.
-Prakash
-
what is the difference between Child thread Worker thread How do we create both threads /?? Vikas Amin Embin Technology Bombay
we can create UI(user interface) thread with the CreateThread() or AfxBeginThread ()api we have to pass the class as a parameter to this function which is derived from the CWinThread and should be able to provide RUNTIME_CLASS. CWinThread handles the Message pump. and what we normaly create the threads are worker threads (i.e passing the threadproc to AfxBeginThread() function) Thanks and Regards Laxman FAILURE is the first step towards SUCCESS :cool: