Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Why glibc-manpages aren't installed when nptl is enabled?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Zoltan
Guru
Guru


Joined: 27 Aug 2003
Posts: 394
Location: Moscow, Russia

PostPosted: Wed Nov 26, 2003 3:58 pm    Post subject: Why glibc-manpages aren't installed when nptl is enabled? Reply with quote

Subject basically says it all. When nptl support is enabled the glibc-manpages aren't unpacked and therefore aren't merged into glibc installation. What is the reason for this?

Code:
    # Extract pre-made man pages.  Otherwise we need perl, which is a no-no.
    mkdir -p ${S}/man; cd ${S}/man
    use_nptl || tar xjf ${FILESDIR}/glibc-manpages-${MY_PV}.tar.bz2

_________________
Light travels faster than sound. That's why some people appear bright before you hear them speak.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9005
Location: beyond the rim

PostPosted: Wed Nov 26, 2003 5:38 pm    Post subject: Reply with quote

Those are only additional manpages, likely for pthreads.
Back to top
View user's profile Send private message
Zoltan
Guru
Guru


Joined: 27 Aug 2003
Posts: 394
Location: Moscow, Russia

PostPosted: Wed Nov 26, 2003 5:47 pm    Post subject: Reply with quote

Yes but today I decided to test how threads are working with nptl and decided to write a small C program and found there are no man pages for pthreads. NPTL is native linux implementation of pthreads, right? So why no man pages for them?...

Simple java thread using program

Code:
public class ManyThreads extends Thread {
        private int number;
        public ManyThreads(int n) {
                number = n;
        }
 
        public static void main(String[] args) {
                ManyThreads[] th = new ManyThreads[10000];
                for (int iii = 0; iii < th.length; iii++) {
                        th[iii] = new ManyThreads(iii);
                        th[iii].start();
                }
 
                for (int iii = 0; iii < th.length; iii++) {
                        try {
                                th[iii].join();
                        } catch (InterruptedException e) {
                                e.printStackTrace();
                        }
                }
        }
 
        public void run() {
                System.err.println("Number = " + number);
                try {
                        sleep(100000);
                } catch (InterruptedException e) {
                        e.printStackTrace();
                }
        }
}


creates a java process with virtual memory size up to 2Gb and then the thread creation fails (sun-jdk-1.4.2_02, btw, is such memory usage normal?) so I want to write the same program in C and see how things work on my system.
_________________
Light travels faster than sound. That's why some people appear bright before you hear them speak.
Back to top
View user's profile Send private message
Zoltan
Guru
Guru


Joined: 27 Aug 2003
Posts: 394
Location: Moscow, Russia

PostPosted: Wed Nov 26, 2003 7:26 pm    Post subject: Reply with quote

Ok a C stress thread using program. Ends up for the same reason as java - the process virtual size gets up to 2Gb and then there is a memory allocation problem. I am curious as to is this really normal to get such huge virtual size of a process? It fails for me after creating just 255 threads...

Code:
#include <pthread.h>
#include <time.h>
#include <errno.h>
 
void *run(void *param)
{
  sleep(30);
  return 0;
}
 
#define NTHREADS 1000
 
int main()
{
  pthread_t h[NTHREADS];
  int i, j;
  for (i = 0; i < NTHREADS; i++) {
    if (pthread_create(&h[i], 0, &run, 0)) {
      printf("pthread_create: %s\n", strerror(errno));
      break;
    }
  }
 
  printf("Managed to create %d threads\n", i);
 
  for (j = 0; j < i; j++)
    if (pthread_join(h[j], 0)) {
      printf("pthread_join: %s\n", strerror(errno));
      break;
    }
  return 0;
}

_________________
Light travels faster than sound. That's why some people appear bright before you hear them speak.
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Thu Dec 04, 2003 4:05 pm    Post subject: Reply with quote

definitely for pthreads.

how do I get the pthread man pages? I'm trying to write a program with pthreads.

think about this, why would I want to have a glibc with nptl enabled but no pthreads documentation?? that's what nptl is for, better pthreads! :wink:

Genone wrote:
Those are only additional manpages, likely for pthreads.

_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
zojas
Veteran
Veteran


Joined: 22 Apr 2002
Posts: 1138
Location: Phoenix, AZ

PostPosted: Thu Dec 04, 2003 4:11 pm    Post subject: Reply with quote

Zoltan wrote:
Ok a C stress thread using program. Ends up for the same reason as java - the process virtual size gets up to 2Gb and then there is a memory allocation problem. I am curious as to is this really normal to get such huge virtual size of a process? It fails for me after creating just 255 threads...


with linux_threads (before nptl) this happened because each thread had a certain amount of stack space automatically allocated for it at creation time (8mb I believe). a process is only allowed 2gb of virtual address space. 2gb/8mb = 256.

you use to be able to work around this by using setrlimit to LOWER the amount of space allocated.

Code:

  lim.rlim_cur = 512*1024;
  lim.rlim_max = 512*1024;
  setrlimit( RLIMIT_STACK, &lim );


that would allow around 1000-2000 threads. (around 1000 if they actually do stuff and use stack space)

but setrlimit no longer has an effect in nptl.
_________________
http://www.desertsol.com/~kevin/ppc
Back to top
View user's profile Send private message
Cicero
Apprentice
Apprentice


Joined: 21 Jul 2003
Posts: 220

PostPosted: Fri Jul 02, 2004 3:41 am    Post subject: Reply with quote

Just thought I'd bump this, since there never really was an answer, and this has been bugging me. What is the reason to not have pthreads man pages when you're using nptl? Do I need to file a bug?
Back to top
View user's profile Send private message
Grahammm
Tux's lil' helper
Tux's lil' helper


Joined: 01 Sep 2004
Posts: 82
Location: Berkshire UK

PostPosted: Sat Oct 02, 2004 7:50 am    Post subject: Reply with quote

Not just man pages, but it would be nice if there were info pages for pthreads, either with glibc (as they were for the 'old' linux pthreads) or as a separate info topic.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum