WG: Memory Problem with POSIX Thread under Windows XP

Martin Jöhren m.joehren@hoppe-bmt.de
Tue Aug 22 08:03:00 GMT 2006


Hello everyone,

ich have a problem under Windows XP using CYGWIN 3.1.17(6)-release
(i686-pc-cygwin) with GCC 3.4.4 with the following code:


void *testThread(void *data) 
{ 
    double kk = 1.232231212; 
    printf("\r\n%f",kk); 
    //pthread_exit(NULL); 
    return(NULL); 
} 

int main (int argc, char *argv[]) 
{ 
    pthread_t t; 

    while(1) 
    { 
        
        pthread_create(&t,NULL,testThread,NULL); 
        pthread_join(t,NULL); 
        
        
    } 
        return 1; 
} 

If i compile and start the executing file I can see in the windows
taskmanager, that the memory used by the program increases continuesly every
second. If I change the code in the testThread function so that printf
prints an integer variable, instead of double or float, on the console,
there won't be a problem. A friend of mine told me, that he tried this code
under Linux and that he hasn't had this problem until now. So have I made a
mistake in configuring my system or is it a bug? I have to mention that the
thread count, which can be observed in the taskmanager too, stays stable at
3 threads. 

Thx a lot for your support guys...

Greetz

Martin Jöhren 
Hoppe Bordmesstechnik 
Tel: +49 40/56 19 49-24 
Fax: +49 40/56 19 49-99 
e-mail: m.joehren@hoppe-bmt.de 
Internet: www.hoppe-bmt.de  



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list