Which IPC between multiple threads will suit most in scenerio?

Hi Friends,

I am designing a solution for a problem: in which my master thread receiving network message and processing them, during processing of each message i need to communicate remote database \(that is actually a separate external  module\)that cause a delay of arount 2 second \(\), After getting result from external database module i can complete processing of my each incomming message. from now i have to ensure that if i was processing 600 message per second \(this was the case when i was not communicating remote database\) earlier when i was not using remote database that is causing delay.. this time my message processing should not affect due to remote database interaction. Does there is a solution through creating multiple threads and IPC \(memory queue or  shared memory\)  so that i can minimize my delay at remote database query.

Asyn I/O and maintaining a state machine for all request processing will help you here. A thread-pool is require for both side network i/o