Skip to content

Implement Proposal: Threads #35

@ErikMcClure

Description

@ErikMcClure

inNative needs to implement Threads to support downstream customers. This requires implementing atomic instructions (which is fairly easy) and shared memory (which is much harder). In order to avoid changing the base pointer (which would break everything), all shared memories must provide a maximum size, which the runtime must then reserve in advance.

We've already migrated to using VirtualAlloc memory on Windows, and we already use mmap() on Linux, so any memory with a maximum size doesn't change it's base pointer location, ever, which allows the optimizer to completely drop the re-evaluation of the memory pointer. Thus, we just need to add a shared flag to memories and ensure the LLVM memory model knows they won't change between threads.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions