|
From: | Marcel Stadtmann |
Subject: | Bug in thread code |
Date: | Tue, 31 Dec 2002 14:43:24 -0000 |
Hi All,
I found a bug in the thread code section. (Used Version GNU Common C++ '2' 1.0.7)
After starting abount 1024 thread's, i got the errorcode 11.
Systeminfo:
SuSE Linux 2.4.10
Used Version GNU Common C++ '2' 1.0.7
complied with gcc Version 2.95.3
It's very easy to get the error:
1. Take the sample code tcpthread.cpp from the demo section:
2. Change timeout on myTCPSession from 20000 to 10
void myTCPSession::run(void)
{
InetAddress addr = getLocal();
*tcp() << "welcome to " << addr.getHostname() << " from socket " << so << endl; mutex.enterMutex();
*tcp() << "called from thread " << count << endl; mutex.leaveMutex();
sleep(20000); <------ Replace this with sleep(10);
*tcp() << "ending session" << endl;
}
3. Make a quick connecting script like this:
#!/bin/sh
while true; do
telnet localhost 4096
done
After about 1024 start's the demo code is hanging.
Also my own Programm has the same fault.
[Prev in Thread] | Current Thread | [Next in Thread] |