Subj : Re: pthread_create and memory To : comp.programming.threads From : Gio67 Date : Fri Mar 11 2005 10:55 am Thank you.I try but nothing change. Do you have the same problem ? Is possible that the problem depends from whitch library I use ? "jd" ha scritto nel messaggio news:d0rsm2$284$1@news.supermedia.pl... > > I hava fedora core 2 linux system with kernel 2.6.5-1.358 and i have > > installated the pthread library. I try to use the function pthread_create > > (). > > I done this simplex test:and work fine. > > The only problem is that after each new thread the memory of my process in > > increased of 10 MB !!! Why ?? > > Because each thread has it's own stack. In this case it looks like it's size > is one megabyte - that's all. > > You can change size of process' stack using pthread_attr_setstacksize() > function. > > pthread_attr_t attr; > pthread_attr_init(&attr); > pthread_attr_setstacksize(&attr, MY_STACK_SIZE); > > pthread_create(&tid, &attr, some_fun, some_arg); > > Error checking here and there and everything should be fine. > > JD > > .