This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
RE: [PATCH] Native POSIX Thread Library(NPTL) ARMSupportingPatches(1/3)
- From: Philip Blundell <pb at nexus dot co dot uk>
- To: "Hu, Boris" <boris dot hu at intel dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "Perez-Gonzalez, Inaky" <inaky dot perez-gonzalez at intel dot com>, Daniel Jacobowitz <drow at mvista dot com>, Wolfram Gloger <wmglo at dent dot med dot uni-muenchen dot de>, "Libc-Alpha (E-mail)" <libc-alpha at sources dot redhat dot com>, "NPTL list (E-mail)" <phil-list at redhat dot com>
- Date: 13 Jun 2003 14:22:15 +0100
- Subject: RE: [PATCH] Native POSIX Thread Library(NPTL) ARMSupportingPatches(1/3)
- References: <37FBBA5F3A361C41AB7CE44558C3448E1A1894@pdsmsx403.ccr.corp.intel.com>
I was thinking that the kernel would select a location for the variable
within the user's address space, probably at the top of the initial
stack (say 0xbffffffc), and communicate that to the application through
the elf auxiliary vector. Or we could just pick an address and define
that as part of the ABI, though that seems a bit ugly.
Your suggestion of __thread_self[cpu_num] does seem like an attractively
simple method, except that I can't think of any good way for the thread
to know which cpu it's currently executing on. Given that a context
switch might result in it flipping onto another cpu at any time, I think
you'd always have a race between obtaining the cpu number and loading
the value from the __thread_self array.
p.
On Fri, 2003-06-13 at 04:36, Hu, Boris wrote:
> THREAD_SELF() is heavily used in nptl, such as pthread_create(),
> pthread_exit(), pthread_join(), etc.
>
> I have forword several related discussion mails to linux-arm-kernel but no
> responsed. :(
>
> About SMP issue, first, I wonder if it needs to support so far, for there is
> no SMP ARM so far. Secondly, even when SMP ARM appears in the future,
> it is easy to extend the current solution -- change __thread_self to
> __thread_self[cpu_num]. Do I miss sth?
>
> I have a question about letting kernel choose the location of the thread
> variable rather than the application. The benefit of the way is the kernel
> could improve the variable access performance by dcache lockdown.
> But how does the user space program to access the thread variable in
> the kernel space? system call?
>
> boris