I'd like to thank you this useful c++ library, which has help me a lot to introduce to develop c++ in linux.
I've experienced some troubles with the class Thread, when implementing a multithreading server. This server acts in the following manner:
1. Listen new incomming tcp connections.
2. Create a new thread to serve the request
3. This thread is activated and start running
4. The thread finish its executions and it is destroyed.
This method works rightly, at least for the first 1500 (more or less, I'm not sure for the number) incomming connections. After these, the threads are created, but the method Thread.start() doesn't produce any effect.
while (serverSocket->isPendingConnection()) {
thread_Service = new Thread_Service (serverSocket);
thread_Service -> start(); // THIS IS THE BUGGY LINE
}
}
catch(Socket *socket) {
<etc>
}
}