attempt to improve efficiency of server...
...by not waking worker threads unless a socket is actually ready to process data
This commit is contained in:
parent
891227bf9d
commit
46378083a0
1 changed files with 4 additions and 2 deletions
|
@ -646,10 +646,12 @@ void queue_data(TCPsocket sock,const config& buf, const bool gzipped)
|
|||
|
||||
bufs.push_back(queued_buf);
|
||||
|
||||
sockets_locked.insert(std::pair<TCPsocket,SOCKET_STATE>(sock,SOCKET_READY));
|
||||
socket_state_map::const_iterator i = sockets_locked.insert(std::pair<TCPsocket,SOCKET_STATE>(sock,SOCKET_READY)).first;
|
||||
if(i->second == SOCKET_READY || i->second == SOCKET_ERRORED) {
|
||||
cond->notify_one();
|
||||
}
|
||||
}
|
||||
|
||||
cond->notify_one();
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
Loading…
Add table
Reference in a new issue