Hello all!
I found the cause for it..
Quote:
|
Note - When there is no explicit synchronization to prevent it, a newly created, detached thread can die and have its thread ID reassigned to another new thread before its creator returns from pthread_create(). For nondetached (PTHREAD_CREATE_JOINABLE) threads, it is very important that some thread join with it after it terminates -- otherwise the resources of that thread are not released for use by new threads. This commonly results in a memory leak. So when you do not want a thread to be joined, create it as a detached thread.
|
(from
Further Threads Programming:Thread Attributes (POSIX))
When i initialized the threadattr whit the parameter PTHREAD_CREATE_DETACHED there was no memory leak anymore!
!!!!!





*just to remember that this socket implementation is not a good one for producing, since it creates one thread per each new connection accepted...
The best way to implemented is to limit a maximum number of connections.