Title: bpo-32243: Use monotonic clock for thread timeouts; more flexibility for very small switch intervals by embray · Pull Request #4964 · python/cpython · GitHub
Open Graph Title: bpo-32243: Use monotonic clock for thread timeouts; more flexibility for very small switch intervals by embray · Pull Request #4964 · python/cpython
X Title: bpo-32243: Use monotonic clock for thread timeouts; more flexibility for very small switch intervals by embray · Pull Request #4964 · python/cpython
Description: This is the work I did toward fixing bpo-32243 (and might be better broken into separate PRs--we'll see). This updates @vstinner's patch from bpo-23428, and on top of it adds a fix to PyCOND_TIMEDWAIT that makes small adjustments, if needed, to the timeout (in microseconds) if it's so short that the deadline is always in the past. My experience in profiling the latter fix (just with some print statements) was that on a slow VM, with setting sys.setswitchinterval(1e-6) on a slow system, this would typically go through the while loop I added to PyCOND_TIMEDWAIT twice (i.e. it would increase the timeout once). On rarer occasions it would go through three times. With sys.setswitchinterval(1e-5) it would sometimes go through the loop twice--usually just once. And for longer switch intervals than that it would always go through the loop only once. This does all unfortunately come at the cost of an unconditional extra call GETTIME(). https://bugs.python.org/issue32243
Open Graph Description: This is the work I did toward fixing bpo-32243 (and might be better broken into separate PRs--we'll see). This updates @vstinner's patch from bpo-23428, and on top of it adds a fix to PyCON...
X Description: This is the work I did toward fixing bpo-32243 (and might be better broken into separate PRs--we'll see). This updates @vstinner's patch from bpo-23428, and on top of it adds a fix ...
Opengraph URL: https://github.com/python/cpython/pull/4964
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:f348f873-c437-27da-7769-45c99639fc68 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CA9E:9775E:C05A36:104D31D:6A4ED703 |
| html-safe-nonce | 9bd117ad42289a006f21c3b48b93d7662e3c64aa9ab6b59cb770d37115589348 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTlFOjk3NzVFOkMwNUEzNjoxMDREMzFEOjZBNEVENzAzIiwidmlzaXRvcl9pZCI6Ijk5ODc0MzgxMTIzNTQzNjI5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aad4547d9ba01981495b481fdac3678c1f38516e3622d6dedb2bdd2fada81e20 |
| hovercard-subject-tag | pull_request:159706940 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/4964/files |
| twitter:image | https://avatars.githubusercontent.com/u/676149?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/676149?s=400&v=4 |
| og:image:alt | This is the work I did toward fixing bpo-32243 (and might be better broken into separate PRs--we'll see). This updates @vstinner's patch from bpo-23428, and on top of it adds a fix to PyCON... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c37fe3e3f5f306900bd5b6bee97463f66c938b2c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width