@chrismcb said:
Eh? What are threads going to give me?
I don't know about your particular system but in general you might want to block until a certain condition is met rather than for a set amount of time. Worker threads are nice for that.
Example:
WndProc()
{
(check if message needs to be processed)
(save message to threadsafe queue)
(wake message processor thread if thread is sleeping)
}
(in a seperate thread):
MessageProcessor()
{
while(true)
if (threadsafe queue has messages)
(get message from queue)
(process message)
else
(sleep until new messages arrive)
}
Of course this introduces a lot of thread safety issues that you have to worry about, but it allows you to do things like receive windows messages while you are processing earlier ones.