Héllo guilers!
This is more like system programming question, but hopefully someone
will enlighten me.
I'd like to create a pool of thread with one producer and several
consumers. This needs comes from the need to make my database server
multithread. The flow of the program I imagine is the following:
1. The client application need to do a query against the database
2. The client open a connection against the server
3. The client send the query
4. The server's main thread accept a new connection
5. The server dispatch the connection to consumer threads
6. The consumer thread reads the query, execute it, returns the result
and close the connection
The point I'm trying to solve is the point 5, when the server main
thread receive a new connection it must send the new connection to one
of the consumer.