This is Windows server application being written in VC++. I am going to use threadpool to handle various request objects coming to the server. Obviously, when a thread is working on particular request and writing its response to the socket, other thread has to wait till it finishes. I fear this probably is not efficient way to use threadpool.
My question therefore is: If a thread in the threadpool is waiting for thread synchronization object to be freed, it would not be efficient way to use threadpool. Is there any way we can avoid this? (Possibly, knowing in advance if the object is free before allocating thread to work upon)