Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utility thread and further threading support #279

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

Maqrkk
Copy link
Member

@Maqrkk Maqrkk commented Jan 14, 2025

No description provided.

@@ -1041,6 +1041,7 @@ CheerpWriter::COMPILE_INSTRUCTION_FEEDBACK CheerpWriter::handleBuiltinCall(const
stream << "import(" << threadingObject << ".script).then(m=>m.default()).catch(e=>{if(e!=='LeakUtilityThread')throw e;});";
else
stream << "importScripts(" << threadingObject << ".script);";
stream << "postMessage('hi');";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed? do we listen for this message on the other side?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If required please let's use a more appropriate string. This feel amateurish.

Maqrkk and others added 10 commits February 3, 2025 11:27
…ility

otherwise globals used by the utility thread will be reset on
initialization
The size was wrong when booleans were used as thread locals. We now align the thread local area to 8 bytes and calculate the size based on that.
Since there are now 2 places in the code where a new Worker is made, we move the text of the blob into a variable.
This intrinsic will be used in the ThreadLocalLowering pass to bypass a dependency issue with LinearMemoryHelper.
This pass will make it possible to use wasm threadlocals in genericjs, by creating and calling a function in wasm that will calculate the address in memory of the threadlocal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants