This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DLOPEN and Statically linked executable


On Fri, Jun 21, 2002 at 04:15:54PM +0200, Jakub Jelinek wrote:
> On Fri, Jun 21, 2002 at 01:10:30PM +0200, Jeroen Dekkers wrote:
> > On Fri, Jun 21, 2002 at 12:42:03PM +0200, Jakub Jelinek wrote:
> > > On Fri, Jun 21, 2002 at 02:02:10PM +0400, Peter Zaitsev wrote:
> > > > Also I would not agree about such architecture.  Thread-per client
> > > > architecture is quite convenient for many applications.   Not only
> > > 
> > > It may be convenient, but it also means you don't care
> > > at all about wasting system resources (every thread currently eats some
> > > unswappable kernel stack, its userland stack, etc.). Also, on IA-32 there
> > > is hardware limitation that you can have only up to 8192 threads
> > > in one application (though glibc limits this to 1024 threads normally).
> > 
> > You are talking about Linux, right? But glibc also runs on other
> > systems with other kernels which don't have the same limitation as
> > Linux has.
> 
> It is in fact not a Linux limitation. IA-32 LDT can have only 8192 segments,
> and TLS ABI mandates %gs:0 as thread pointer.
> Well, maybe you could get around this if kernel knew everything about what
> is %gs used for and why, then you could only use a few GDT entries (the same
> number as CPUs) and at every context switch save/restore what was pointed
> by %gs:0, assuming nothing other than %gs:0 is used, but dunno how
> it would go together with apps using segment registers for other things.

We don't use the LDT for this, we have a constant %gs:0 pointing to a
location in memory and that location has a pointer to the thread-local
storage. On context switches the pointer at the address %gs:0 points
to is changed. (At least if I understand Roland's changes to Mach
correctly)

Jeroen Dekkers
-- 
Jabber ID: jdekkers@jabber.org  IRC ID: jeroen@openprojects
GNU supporter - http://www.gnu.org

Attachment: msg00113/pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]