• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Threads problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Threads problems


  • Subject: Threads problems
  • From: Matthew Jenkins <email@hidden>
  • Date: Mon, 21 Feb 2005 17:28:54 +0000

Hi,
I am having "issues" with threads on darwin and memory consumption.

It seems that with every thread I create about 4k of resident memory is allocated. That memory never seems to be reclaimed at thread termination.

My little test program, which creates 100 threads at 5 second intervals is posted below.

Is there something fundamental that I'm missing?

Cheers,

Matt
-- Darwin dannii.hq.inty.net 7.8.0 Darwin Kernel Version 7.8.0

#include <stdio.h>
#include <pthread.h>

void mythread()
{
        printf("moo\n");
}

int main()
{
        int i;
        pthread_t q;
        for(i=0; i<100; i++)
        {
                pthread_create(&q,NULL,(void *)&mythread,NULL);
                sleep(5);
        }
        return(0);
}


Scanned for viruses by MailDefender _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Threads problems
      • From: Jonas Maebe <email@hidden>
  • Prev by Date: Re: Various tools update request
  • Next by Date: Re: Threads problems
  • Previous by thread: Re: Various tools update request
  • Next by thread: Re: Threads problems
  • Index(es):
    • Date
    • Thread