New pthreads library

Richard Henderson rth@twiddle.net
Mon Aug 30 14:25:00 GMT 1999


On Mon, Aug 30, 1999 at 05:15:49PM -0400, Roland McGrath wrote:
> I don't suppose it would be worth adding __attribute__((segment ("%gs")))
> on extern decls.  

Without additional work, that wouldn't be able to accomplish
what you want.  What you _really_ want is something like

  int * __attribute__((seggs)) ptr;

so that %gs is used whenever ptr is dereferenced.  Then you'd do

  struct stuff {
  	int x, y, x;
  };

  #define thread_ptr	((struct stuff * __attribute__((seggs))) 0)

  thread_ptr->y;

The DSP folks would love for us to be able to represent something
like this, since differing address spaces for them have different
scheduling characteristics.  (E.g.  you may schedule two loads in
the same cycle, but only if one is from X memory and the other from
Y memory.)


r~


More information about the Libc-hacker mailing list