-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Clarification on what is needed for advancement toward per-interpreter GIL. #103
Comments
Here are the specific things that would need to be done before beta1:
The only (mild) controversy I'm aware of is with the project as a whole, including cases where some folks were premature in moving some objects to per-interpreter state. I've written down a more concrete, exhaustive (though probably still slightly incomplete) TODO list here: |
Could we decouple this decision from PEP 554? IIUC that PEP is about the specific API to offer for communicating between subinterpreters (which is important when we have separate GILs since you can't share objects). It looks rather old and I'm not sure I like the specifics of the proposed API that much. I would rather not have it accepted (or have it very provisionally accepted) than have to live with it since we were in a rush to get all this done before 3.11b1. |
There is also some controversy (of varying degrees) when it comes to applying PEP 630 to the stdlib. See also #99 |
+1
The PEP needs a slight update and then we can revisit its merits elsewhere. |
I've added this to our agenda |
I'd like to know what is the plan with static types (esp. in extensions). Can we keep them? (I should probably say in PEP 630 that it's not necessary to convert all static types to heap ones: many people think “apply PEP 630” implies that, and I would like to strongly suggest it for third-party libraries, but it makes less sense in stdlib.) |
Oh, I had missed that, and I think most people have missed that. There seems to be a systematic programme to do convert all static types somewhere in bpo. |
That's the issue I linked. It's missing motivation/rationale. |
It mostly depends on if we end up with immortal objects or not. If we do then the story is relatively straight-forward. We'd have to update Without immortal objects we would have to have a distinct object per interpreter for each static type. I expect in the core (including builtin modules) we would leave the static types alone and use them only for the main interpreter. Then for subinterpreters we would make a copy (and do some fixups). So I suppose "is a PEP needed for immortal objects?" is the most pressing question. (Of course, I'd still like feedback on the other aspects of per-interpreter GIL. 🙂)
It is sort of part of this effort. 🙂 Regardless of how, all the global variables in our extension modules needs to be made per-interpreter (or at least safe to share between interpreters without a GIL). The work you are asking about helps and is probably the best solution. It just isn't necessary for per-interpreter GIL. Also, IIUC the work on extension modules started many years ago with PEP 384, so it isn't new. However, the effort accelerated in the last couple years under @vstinner's push, at least in part motivated by the goal of a per-interpreter GIL.
I expect that depends on the outcome of #99. |
FYI, yesterday I ran the benchmarks on Eddie's branch and found a 4% slowdown. There are a number of strategies that will help us recover that, hopefully back to performance-neutral. |
The problem I see is that “the work” could include changes done without a good reason. I don't want to blame anyone, and I know I am also part of the problem. But I'd like to untangle it and help avoid making similar mistakes in the future. (Hopefully without an overbooked SC as gatekeepers of innovation, too, but that's not where we are now.)
For me, yes. I would definitely like to see a write-up on the pros and cons and the whys, rather than having the info spread across comment threads. But I understand it's hard to do with an active research topic. Hm, maybe “which parts of a PEP are needed?” could be a better question to ask than “is a PEP needed”? I often look at the PEP template to remind myself what to think about when considering a change, without actually writing a PEP. e.g. here the motivation is common to all steps, but it might be good to write down individual rationales, so we can check the “why”. |
FTR, I took a quick glance at the extension modules with static types to see if they (they types) access global state:
|
After a chat with @vstinner, I'm going to just go ahead with a PEP for immortal objects and one for per-interpreter GIL. Both should be fairly focused (unlike my old peps repo PR). We can continue any discussion on python-dev. |
Here's my update to PEP 630: python/peps#2319 |
(FYI, I've spoken with @brettcannon about all this previously.)
I've been looking over what needs to be done to get to per-interpreter GIL, as well as concerns folks have brought up about the project. There's a chance things could move along fast enough to reach per-interpreter GIL in time for 3.11b1, so I want to see what the steering council thinks needs approval first (i.e. a PEP).
Some things to note:
So it isn't so clear to me what value another PEP provides. Aside from existing PEPs, I could imagine possibly the following, but I'm not sure any of them provide much value.
FYI, I started python/peps#2212 as a sort of dump of the whole thing, but it covered too much. Would it make more sense to add a page to the devguide about the project instead of a PEP?
Anyway, I figured I'd get your feedback sooner rather than later. 🙂
The text was updated successfully, but these errors were encountered: