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

Implement async termination of blocking thread (#2516) #815

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

wenyongh
Copy link
Owner

Send a signal whose handler is no-op to a blocking thread to wake up the blocking syscall with either EINTR equivalent or partial success.

Unlike the approach taken in the dev/interrupt_block_insn branch (that is, signal + longjmp similarly to OS_ENABLE_HW_BOUND_CHECK), this PR does not use longjmp because:

See also bytecodealliance#1910

Send a signal whose handler is no-op to a blocking thread to wake up
the blocking syscall with either EINTR equivalent or partial success.

Unlike the approach taken in the `dev/interrupt_block_insn` branch (that is,
signal + longjmp similarly to `OS_ENABLE_HW_BOUND_CHECK`), this PR
does not use longjmp because:
* longjmp from signal handler doesn't work on nuttx
  refer to apache/nuttx#10326
* the singal+longjmp approach may be too difficult for average programmers
  who might implement host functions to deal with

See also #1910
@wenyongh wenyongh merged commit c4279bf into wenyongh:main Sep 21, 2023
13 checks passed
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.

2 participants