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]

__libc_tsd_address


I'm currently cleaning up my port of Glibc to Syllable and fixing the 
remaining few bugs.  The most pressing problem currently is that the 
allocator is not thread-safe, something that is critical on Syllable.  I have 
provided a proper implementation of libc-lock.h but had overlooked libc-tsd.h

I'm confident that I can provide suitable functionality for 
__libc_tsd_declare, __libc_tsd_get and __libc_tsd_set on top of native TLD 
functions.  However __libc_tsd_address poses a special problem.  The address 
of a TLD on Syllable is meaningless; TLD objects are managed by the kernel.  
While it may be theoretically possible to construct a valid address from a 
Syllable TLD handle (valid in so far as the address would be within the 
threads own address space), it certainly wouldn't be valid to use that 
address to get or set the TLD.

It seems that __libc_tsd_address makes a vast assumption about how TLDs are 
implemented on any given platform, namely 1) The TLD are wholy managed in 
user-space and 2) The "address" of any TLD should be valid and something 
tangable that some other code should have access to.  On Syllable, neither of 
these assumptions are valid.

Greping the code shows that the only place __libc_tsd_address is used is 
include/ctype.h, where again there appear to be some rather major assumptions 
about what is valid when using a TLD.

Before I start suggesting that __libc_tsd_address needs to be removed or 
restricted in some way I'd like to ask if anyone can clue me on why exactly 
it exists in the first place and why it's used by include/ctype.h?  Is there 
any hope of re-writing ctype.h not to use __libc_tsd_address?

-- 
Vanders
http://www.syllable.org
http://www.liqwyd.com


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