8000 bpo-32604: Expose the subinterpreters C-API in a "private" stdlib module. by ericsnowcurrently · Pull Request #1748 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-32604: Expose the subinterpreters C-API in a "private" stdlib module. #1748

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

Merged
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
be93a28
Add the _interpreters module to the stdlib.
ericsnowcurrently Dec 14, 2016
6f7a120
Add create() and destroy().
ericsnowcurrently Dec 29, 2016
941efdd
Finish nearly all the create/destroy tests.
ericsnowcurrently Jan 1, 2017
95e7342
Add run_string().
ericsnowcurrently Dec 29, 2016
92aeaac
Get tricky tests working.
ericsnowcurrently Jan 2, 2017
b6e2f3a
Add a test for a still running interpreter when main exits.
ericsnowcurrently Jan 2, 2017
c15e79b
Add run_string_unrestricted().
ericsnowcurrently Jan 4, 2017
8d809c7
Exit out of the child process.
ericsnowcurrently Jan 4, 2017
55bb53c
Resolve several TODOs.
ericsnowcurrently Jan 4, 2017
cad0a91
Set up the execution namespace before switching threads.
ericsnowcurrently Jan 4, 2017
1395c58
Run in a copy of __main__.
ericsnowcurrently Jan 4, 2017
e0e8176
Close stdin and stdout after the proc finishes.
ericsnowcurrently Jan 4, 2017
0eb4acc
Clean up a test.
ericsnowcurrently Jan 4, 2017
3562084
Chain exceptions during cleanup.
ericsnowcurrently Jan 4, 2017
8e7e724
Finish the module docs.
ericsnowcurrently Jan 4, 2017
f8173fb
Fix docs.
ericsnowcurrently May 23, 2017
84cea38
Fix includes.
ericsnowcurrently Dec 5, 2017
48a1a38
Add _interpreters.is_shareable().
ericsnowcurrently Nov 28, 2017
bbdadb0
Add _PyObject_CheckShareable().
ericsnowcurrently Dec 4, 2017
9a75fd2
Add _PyCrossInterpreterData.
ericsnowcurrently Dec 4, 2017
f38b138
Use the shared data in run() safely.
ericsnowcurrently Dec 7, 2017
0055e80
Do not use a copy of the __main__ ns.
ericsnowcurrently Dec 7, 2017
9030634
Never return the execution namespace.
ericsnowcurrently Dec 8, 2017
df53c6c
Group sharing-related code.
ericsnowcurrently Dec 8, 2017
b27597f
Fix a refcount.
ericsnowcurrently Dec 8, 2017
b69a643
Add get_current() and enumerate().
ericsnowcurrently Dec 29, 2016
dc21da6
Add is_running().
ericsnowcurrently Dec 29, 2016
a4dad08
Add get_main().
ericsnowcurrently Jan 4, 2017
bc818e5
Fix an INCREF placement.
ericsnowcurrently Dec 12, 2017
d80ffdb
Fix error propagation.
ericsnowcurrently Dec 12, 2017
f4b8819
enumerate -> list_all.
ericsnowcurrently Dec 12, 2017
c1b2a79
Correctly handle a failed _shared_exception allocation.
ericsnowcurrently Dec 12, 2017
406d1ec
Add _interpreters.RunFailedError.
ericsnowcurrently Dec 12, 2017
6a53db3
Return a simple RunFailedError.
ericsnowcurrently Dec 12, 2017
f1e91b0
(mostly) Fix the unit tests.
ericsnowcurrently Dec 22, 2017
e7c581a
Add tests for shareable objects.
ericsnowcurrently Jan 8, 2018
24095ab
Add None as shareable.
ericsnowcurrently Dec 14, 2017
7ebae2f
Add a registry for shareable types.
ericsnowcurrently Jan 11, 2018
6d562bb
Fix (and clean up) the cross-interpreter-data code.
ericsnowcurrently Jan 12, 2018
237f743
Add basic channel code.
ericsnowcurrently Jan 12, 2018
3b0ca21
Stub out the other channel-related module functions.
ericsnowcurrently Jan 13, 2018
064f710
Drop _cidclass.classname.
ericsnowcurrently Jan 13, 2018
703ac97
Drop some outdated TODO comments.
ericsnowcurrently Jan 13, 2018
e36e4d4
Add a mutex for the registry.
ericsnowcurrently Jan 13, 2018
b973cc4
Add _PyChannelState.mutex.
ericsnowcurrently Jan 13, 2018
6b9e457
Add a mutex for operating on the global list of channels.
ericsnowcurrently Jan 13, 2018
12efb00
Clean up the locking a little.
ericsnowcurrently Jan 13, 2018
310d0ac
Implement _interpreters.channel_list_all().
ericsnowcurrently Jan 13, 2018
8a24220
Implement _interpreters.channel_close().
ericsnowcurrently Jan 14, 2018
7c8ede9
Add channel-related exceptions.
ericsnowcurrently Jan 15, 2018
47d75de
Add _interpreters.ChannelID.
ericsnowcurrently Jan 16, 2018
153bbec
Solidify the "close" story.
ericsnowcurrently Jan 16, 2018
79d31cd
Drop channel_list_interpreters().
ericsnowcurrently Jan 20, 2018
3aad28b
Register ChannelID as a cross-intepreter type.
ericsnowcurrently Jan 20, 2018
db72825
_interpreters -> _xxsubinterpreters.
ericsnowcurrently Jan 26, 2018
6a0c0ff
Fix an un-initialized variable.
ericsnowcurrently Jan 26, 2018
9d50730
NULL-terminate kwlist for PyArg_ParseTupleAndKeywords().
ericsnowcurrently Jan 26, 2018
b31d130
Drop docs for now.
ericsnowcurrently Jan 26, 2018
91e7c8b
Do not check for NULL from PyThreadState_Get().
ericsnowcurrently Jan 26, 2018
7d2cfea
Format "else" statements properly.
ericsnowcurrently Jan 26, 2018
73dad33
Always use braces with if statements.
ericsnowcurrently Jan 26, 2018
ee7141c
Check for a NULL return from PyMem_NEW().
ericsnowcurrently Jan 26, 2018
8ec5137
Return the error.
ericsnowcurrently Jan 26, 2018
65d822e 8000
Always check the result of PyDict_SetItemString().
ericsnowcurrently Jan 26, 2018
2df5aff
Add typedefs.
ericsnowcurrently Jan 26, 2018
9bb05cf
_shared_exception -> _sharedexception
ericsnowcurrently Jan 26, 2018
633a3d3
Free memory in the error case.
ericsnowcurrently Jan 26, 2018
74e7241
Whitelist instead of blacklist for richcompare ops.
ericsnowcurrently Jan 26, 2018
bb8619a
Decref in the error case.
ericsnowcurrently Jan 26, 2018
d785573
Add a Misc/NEWS entry.
ericsnowcurrently Jan 26, 2018
f856035
Do not try to print a bytes object.
ericsnowcurrently Jan 27, 2018
ba94571
Drop some outdated comments.
ericsnowcurrently Jan 27, 2018
9065001
Wrap long lines.
ericsnowcurrently Jan 27, 2018
2ebc68c
Fix some compiler warnings.
ericsnowcurrently Jan 27, 2018
48291af
Always use PyMem_NEW().
ericsnowcurrently Jan 27, 2018
39df95e
Do not try to allocate too much space.
ericsnowcurrently Jan 27, 2018
b07e928
Add Windows build support.
ericsnowcurrently Jan 27, 2018
1bfed0f
Drop Windows build support (for now).
ericsnowcurrently Jan 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Drop some outdated comments.
  • Loading branch information
ericsnowcurrently committed Jan 27, 2018
commit ba945715b241629e0045cb19a798dd653594e313
7 changes: 5 additions & 2 deletions Modules/_xxsubinterpretersmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,6 @@ static PyObject *
channelid_repr(PyObject *self)
{
PyTypeObject *type = Py_TYPE(self);
// XXX Use the qualname?
const char *name = _PyType_Name(type);

channelid *cid = (channelid *)self;
Expand Down Expand Up @@ -1299,8 +1298,12 @@ static PyTypeObject ChannelIDtype = {
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
// Note that we do not set tp_new to channelid_new. Instead we
// set it to NULL, meaning it cannot be instantiated from Python
// code. We do this because there is a strong relationship between
// channel IDs and the channel lifecycle, so this limitation avoids
// related complications.
NULL, /* tp_new */
//(newfunc)channelid_new, /* tp_new */
};

/* interpreter-specific functions *******************************************/
Expand Down
0