This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: libgcj and the NPTL posix threads implementation
- From: Anthony Green <green at redhat dot com>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: "Boehm, Hans" <hans dot boehm at hp dot com>, "'Michael Koch'" <konqueror at gmx dot de>, java at gcc dot gnu dot org
- Date: Mon, 01 Mar 2004 13:59:59 -0800
- Subject: RE: libgcj and the NPTL posix threads implementation
- Organization: Red Hat, Inc.
- References: <Pine.LNX.4.44.0403011159570.11117-100000@ops2.one-point.com>
On Mon, 2004-03-01 at 13:08, Jeff Sturm wrote:
> On Sun, 29 Feb 2004, Anthony Green wrote:
> > + inline _Jv_ThreadId_t
> > + _Jv_ThreadSelf (void)
> > + {
> > + size_t id;
> > + asm ("mov %%gs:0x8, %0" : "=r"(id));
> > + return id;
> > + }
>
> I'm curious what the special significance of offset 0x8 might be.
I believe that returns the posix thread ID, however, as you say...
> As I
> understand TLS on glibc, "move %gs:0, %eax" would place the thread pointer
> in %eax, which is sufficient for these purposes as a pointer to an opaque
> per-thread structure.
Yes, that would work as well.
AG
--
Anthony Green <green@redhat.com>
Red Hat, Inc.