On 11-04-15 10:30 AM, Peter Hull wrote:
2011/4/15 Rafael Ávila de Espíndola<[email protected]>:
On 11-04-15 1:36 AM, Graydon Hoare wrote:
Yes, we have this is a problem for both implementations. On linux at
least we can also use a global thread local variable to hold the C stack
for the OS thread. I have no idea what we should do for OS X in here.

No TLS on OSX? I gather they have a rather different threading system
than linux (and windows); I don't know the exact details.

I don't think any released version has it. There was some activity in LLVM,
so I think they are implementing it.
I've used the pthreads functions* in the past, with a compatibility
layer for those platforms with 'native' tls. It worked ok for me,
would it be suitable for rust?

In the most general case, no. We want to find the C stack to call a C function, so calling one to find it will not do.

We could check where they store the information and implement the same algorithm. The limitation for representing C calls as simple calls in LLVM is that the call expansion has to find the stack with only basic assembly operations. In the case of TLS on linux it is just a load for example.

With a call-to-c intrinsic we can produce as good code, but the inliner will not see through it and there is the problem of a bit of code duplication of the intrinsic expansion with regular calls.

Pete
* i.e. 
http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/pthread_getspecific.3.html
et al


Cheers,
Rafael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to