The Native POSIX Thread Library (NPTL) is a software feature that enables the Linux kernel to run programs written to use POSIX Threads efficiently.
Questions tagged [nptl]
29 questions
1
vote
1 answer
What's the difference between GNU_LIBC_VERSION and GNU_NPTL_VERSION?
Notice these two RedHat Linux system configuration settings:
$ getconf GNU_LIBC_VERSION
glibc 2.3.4
$ getconf GNU_LIBPTHREAD_VERSION
NPTL 2.3.4
I see they correspond to some of the TLS…

Tom
- 10,689
- 4
- 41
- 50
1
vote
2 answers
NPTL Default Stack Size Problem
I am developing a multithread modular application using C programming language and NPTL 2.6. For each plugin, a POSIX thread is created. The problem is each thread has its own stack area, since default stack size depends on user's choice, this may…

Emre Yazici
- 10,136
- 6
- 48
- 55
1
vote
1 answer
How can I decide how much stack I can use after a call to pthread_attr_setstacksize?
I am trying to debug some code regarding stack usage. I have made the following test program (just as an example to figure out how the pthread library works):
#include
#include
#include
#include
#include…

kungjohan
- 475
- 4
- 18
1
vote
0 answers
Linux thread switch overhead vs. process switch overhead
I appreciate that under Linux, threads are mapped onto processes. What I am unclear about is the difference in magnitude between thread switch overhead and process switch overhead using the Native POSIX Threads Library (i.e. kernels >= 2.6), and I'm…

Jon Green
- 141
- 6
1
vote
1 answer
Use NPTL while keeping glibc with linuxthreads
I would like to know if it is possible to test a specific binary with nptl instead of linuxthreads which is embedded in my glibc. I don't want to recompile the glibc because it is the one provided with my specific hardware/software and I don't want…

Jean-Baptiste Reich
- 41
- 1
- 1
- 7
0
votes
1 answer
NPTL: what is MULTIPLE_THREADS_OFFSET and how it is set
There was rather huge commit-git into nptl/glibc:
http://sourceware.org/git/?p=glibc.git;a=commit;h=e51deae7f6ba2e490d5faeb8fbf4eeb32ae8f1ee
by Ulrich Drepper and Jakub Jelinek @ 2007
I interested in the change to lll_lock/lll_unlock
In SMP code,…

osgx
- 90,338
- 53
- 357
- 513
0
votes
1 answer
Compile and use glibc-2.13 from source for ubuntu x86_64 architecture
I am trying to build a modified version of libc/NPTL. My ubuntu version shows that it is version 2.13. I want to create a separate libc/nptl/libpthreads and want to use it for an existing application (like apache) using dynamic loading without…

max
- 1,692
- 5
- 28
- 40
0
votes
0 answers
Binary crashed while calling NTPL function __pthread_setname_np()
I am calling below function to assign name to my thread
pthread_setname_np(tid, name);
However, my binary is crashing with below error:
Thread 9 "ABC" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffec267400 (LWP…

Sudip
- 523
- 2
- 7
- 14
0
votes
1 answer
Difference between __errno_location defined in "csu/errno-loc.c" "nptl/errno-loc.c"
I noticed that in Glibc the macro "errno" got expanded to an invocation of "__errno_location". However, there are two different definitions of "__errno_location":
The one defined in "csu/errno-loc.c" and hence in "libc.a" returns the address of the…

brian
- 265
- 1
- 9
0
votes
1 answer
Incorrect local variable value after pthread_join
I am trying to sum up 1000 elements integer array(where each element is 1) with pthread library by splitting the array in to segments of size 10. So effectively, 100 threads are being used to do that. The results of this parallel operation is as…

Vineel
- 1,430
- 14
- 18
0
votes
1 answer
How are pthreads implemented in Linux kernel(>2.6) using NPTL?
I have come across the POSIX-compliant NPTL(native posix thread library) been mentioned at several forums.
I want to understand how pthreads are implemented with the support of the kernel(linux).
Can anyone please provide a reference to a good…

Monku
- 2,440
- 4
- 33
- 57
0
votes
1 answer
Why two threads in NPTL have different pid in Ubuntu12.04
I tested some code in Ubuntu 12.04 LTS server x64(3.2 kernel), which I think is using NPTL.
when I run
$ getconf GNU_LIBPTHREAD_VERSION
I get
NPTL 2.15
The following is the test code. I compiled it with gcc -g -Wall -pthread
#include…

Chen Kaien
- 29
- 3
0
votes
1 answer
Why accessing pthread keys' sequence number is not synchronized in glibc's NPTL implementation?
Recently when I look into how the thread-local storage is implemented in glibc, I found the following code, which implements the API pthread_key_create()
int
__pthread_key_create (key, destr)
pthread_key_t *key;
void (*destr) (void…

spockwang
- 897
- 1
- 6
- 15
0
votes
1 answer
What is the purpose of this code segment from glibc
I am trying to understand what the following code segment from tls.h in glibc is doing and why:
/* Macros to load from and store into segment registers. */
# define TLS_GET_FS() \
({ int __seg; __asm ("movl %%fs, %0" : "=q" (__seg)); __seg; })
I…

Gabriel Southern
- 9,602
- 12
- 56
- 95