[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2020-05-14 Thread STINNER Victor


STINNER Victor  added the comment:

I see two options:

* Add a field to PyObject, but only in a special debug mode. Maybe not even in 
Py_DEBUG (since I managed to make Py_DEBUG ABI-compatible with the release 
mode!)

* Add an hash table mapping an object to its interpreter. The hash table would 
only be used in debug mode. It may even be turned on at runtime depending on a 
command line option or something else.

See also bpo-40514: [subinterpreters] Add 
--experimental-isolated-subinterpreters build option.


Antoine: "Can I ask why you're considering this?  I thought you didn't want to 
transfer ownership between interpreters."

I guess that the purpose is to ensure that: detect when an object is shared 
between two interpreters.

Currently, tons of objects are still shared between interpreters. Starting with 
static types: see bpo-40601 "[C API] Hide static types from the limited C API".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2020-05-14 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Subinterpreters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2018-06-22 Thread Eric Snow


Change by Eric Snow :


--
nosy: +emilyemorehouse

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2018-05-29 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

I agree with Victor, we shouldn't add PyObject fields that only have use in 
certain (minority) situations.

The idea of tracking per arena will be non-trivial to implement, as only small 
objects (smaller than 512 bytes) use our own allocator; larger objects go to 
the system allocator.

Can I ask why you're considering this?  I thought you didn't want to transfer 
ownership between interpreters.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2018-05-29 Thread Eric Snow


Eric Snow  added the comment:

Note that I wouldn't call this issue absolutely specific to subinterpreters.  
The "ownership" part is, but tracking the allocator has practical application 
under a single interpreter.  I suppose I could split this issue apart.  I 
lumped the two together because I expected the solution would be the same for 
both.  However, that's not necessarily the case.  Would it help to open a 
separate issue for tracking the allocator?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2018-05-23 Thread Nick Coghlan

Nick Coghlan  added the comment:

Rather than tracking this per object, you could potentially track it per arena 
at the memory allocator level instead. Then if you really need the info (e.g. 
when running the debug allocator), you can check it in a reliable way, but in 
the normal case, you assume the associations are being managed correctly and 
avoid any significant bookkeeping overhead.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33607] [subinterpreters] Explicitly track object ownership (and allocator).

2018-05-22 Thread STINNER Victor

Change by STINNER Victor :


--
title: Explicitly track object ownership (and allocator). -> [subinterpreters] 
Explicitly track object ownership (and allocator).

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com