Mark Corben - 2001-06-13

I am having problems with Threads not exitting on Solaris 7. I am using CommonC++ ver 1.3.2 which has been compiled with gcc 2.95.2.

When using the demo program 'tcpthread.cpp' it appears that threads are not being "released" if multiple telnet sessions are made to the tcpthread server (myTCPSocket) at the same time. Ie if two telnet sessions are made to the server then threads that were originally created for the TCPSessions still remain after the connections have closed. When the server initially runs, using 'top' , I can see that there are 4 threads/lwps running. Once the two telnet connections are established there are 6 threads overall for the tcpthread process. This remains the same after the telnet sessions are closed down.

In addition memory is not released for these TCPSessions whether it is one or more.

The connections/threads appear to accumulate if more connections are made. However it does appear to only happen in multiples of 2 telnet sessions.
ie Having 3 telnet sessions will not increase the number of threads (from 6 in this case) but 4 will increase it (to 8 threads).

I do have sample logs of this scenario with two telnet sessions to better explain what's going on but have not put them here due to space constraints.

This problem still occurs for the latest Common C++ 1.4.2.

Any advice /suggestions would be appreciated