-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
_thread
module docs: update yet another bullet point in the *caveats* list
#125058
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
Comments
The question is whether nowadays the possibility to interrupt a blocking acquisition of a lock is possible only on POSIX systems (I can observe that on my Linux system), or maybe also on others? (i.e., Windows?) Unfortunately I am not sure what is the right answer, therefore a Python threading expert needs to speak up. According to the Experts Index the right persons are you, @gpshead and @pitrou. I hope, this is the right way to ask you for help? Thank you in advance! :) |
PS I'd happy to provide a PR with an appropriate docs patch – when I'm sure what is the state of affairs when it comes the possibility to interrupt a lock acquisition on platforms with a non-Pthreads-based threads implementation. |
Looks like Windows is using In order to be interruptible, it needs to be a |
@gpshead @zooba Thank you for your feedback! I presume that something along the lines of the following would be appropriate:
|
PS Perhaps adding that
|
I think this used to be the case, but it got replaced by the faster native mutex for performance. |
@kumaraditya303 has a PR to use |
My previous comment was incorrect. Line 114 in e99f159
|
OK, so it remains platform-dependent whether |
Yes. But concretely, it's interruptible on POSIX, not on Windows. |
Regardless, it seems the
|
PR is ready :) |
…`lock.acquire()` (pythonGH-125141) (cherry picked from commit 0135848) Co-authored-by: Jan Kaliszewski <[email protected]>
…`lock.acquire()` (pythonGH-125141) (cherry picked from commit 0135848) Co-authored-by: Jan Kaliszewski <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Documentation
[Note: This issue is, in a way, a continuation of gh-125025.]
Near the end of the documentation of the
_thread
module there is a list of caveats. One of them – the third one – seems no longer accurate:– whereas it appears that (since Python 3.2) lock acquisitions can be interrupted by signals, at least on platforms using Pthreads.
Linked PRs
_thread
docs regarding interruptibility oflock.acquire()
#125141_thread
docs regarding interruptibility oflock.acquire()
(GH-125141) #125306_thread
docs regarding interruptibility oflock.acquire()
(GH-125141) #125307The text was updated successfully, but these errors were encountered: