Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Access to native thread-local memory #53

Open
wks opened this issue Apr 29, 2016 · 0 comments
Open

Access to native thread-local memory #53

wks opened this issue Apr 29, 2016 · 0 comments

Comments

@wks
Copy link
Member

wks commented Apr 29, 2016

This issue is about accessing thread-local memory/variables defined in native programs (C). One important application is the errno variable in C/C++.

This is only slightly related to #52 which introduces thread-local storage to Mu itself. There is no intention to force Mu's thread-local storage use the same mechanism as native programs.

Thread-local storage in native programs is highly machine/OS/ABI-dependent. The register used to point to thread-local buffers varies, and maybe not all platform have such register.

One possible workaround could be depending on helper functions written in C or assembly.

But if we want Mu to integrate deeper with native programs (i.e. do things more efficiently), we can define more instructions (probably "common instructions") to give Mu more capabilities, such as getting/setting the value of the FS register. But any such instructions would likely be platform-dependent and probably optional for unsuitable platforms.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant