-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
use sigwait for thread-safe and multi-thread-aware signal handling #12904
Conversation
51fe805
to
9b67c63
Compare
9ce97a2
to
a38fee2
Compare
a38fee2
to
905310d
Compare
bump. rebased now that jn/threading is merged. |
c04c801
to
532e216
Compare
this branch should be ready-to-merge content-wise (aside from needing rebase again it seems). I couldn't reproduce the x86 failure locally. Would be great if someone could review and see if anything looks amiss. |
extern ptrint_t bt_data[MAX_BT_SIZE+1]; | ||
extern size_t bt_size; | ||
extern JL_THREAD ptrint_t bt_data[MAX_BT_SIZE+1]; | ||
extern JL_THREAD size_t bt_size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed JL_THREAD
in #14083 since it's not used anymore. Should I add it back or should these go into the tls struct as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these can go in the tls struct (or only one thread could throw/handle an exception at a time)
} | ||
jl_throw_in_thread(0, thread, excpt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to pass the real tid
here
532e216
to
4baa22b
Compare
I've rebased this branch on top of the current master (#14083) at yyc/flex_signals-rebase and also fixed some compiler warnings there. I think we can probably also clean up |
Sounds good. Do you want to go ahead and force-push your branch here and merge this when you are happy with it (possibly squashing the commits a little)? |
I can do that. What about the TODO you have above? |
there's other (preexisting) bug there, so it doesn't need to be a blocking item. just don't cause segfaults (aka stackoverflow) on child threads for now. |
…fore it was setup). Closes #14091
… handling SIGINFO requests
4baa22b
to
e755087
Compare
OK. Done. The code should be identical with the version before apart from some clean up in the I didn't squash too much since I'm not really familiar with signal handling. I only merge my compiler warning fixes into each individual commits and merge the compilation fix in Oscar's commit to the previous one so that this PR is bisect-able on linux without too many compiler warnings. |
I think I'm @tkelman Have you checked if Oscar's fix in this PR solves the race for you on windows without triggering a libuv assertion when threading enabled? |
On your rebase version of this branch (more or less the same right?) everything looked to be in order with llvm 3.3 and threading enabled, so 👍 from me. We could maybe think about turning threading on by default already. |
Cool.
Yes, apart from some clean up that I only pushed to this branch. |
use sigwait for thread-safe and multi-thread-aware signal handling
I will have to check whether this PR made any difference here but it's worth noting that the MSVC build with LLVM 3.3 and threading enabled freezes at the start of bootstrap. |
this is a redesign of the unix signal handling so that it will be more thread-safe and extensible.
yyc: Close #14091