Giuliano Colla wrote:
> BTW could you refresh my memory? What kernel and libc are you running
> with?

linux2.6.22/libc2.3.1

Here is threadbug.c which doesn't show any leaks:

// gcc -lpthread threadbug.c -o threadbug
#include <pthread.h>

void *threadbug() {
  printf(".");
}

main(){
  int i;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_t threads[999];

  while (1) {
    printf("\nstarting threads...\n");
    sleep(3);
    for (i=0;i<1000;i++)
      if ( pthread_create(&threads[i],&attr,threadbug,NULL) )
        perror("pthread_create");

    printf("\nfreeing threads...\n");
    sleep(3);
    for (i=0;i<1000;i++) {
      pthread_join(threads[i], NULL);
      printf(".");
    }
  }
}


Thanks!

--
Al

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to