On 6/24/06, <b class="gmail_sendername">Bob Ippolito</b> &lt;<a href="mailto:bob@redivi.com">bob@redivi.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Jun 24, 2006, at 2:46 AM, Nick Coghlan wrote:<br><br>&gt; Brett Cannon wrote:<br>&gt;&gt; Yep.&nbsp;&nbsp;That API will be used directly in the changes to pymalloc and<br>&gt;&gt; PyMem_*() macros (or at least the basic idea).&nbsp;&nbsp;It is not *only* for
<br>&gt;&gt; extension modules but for the core as well.<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; Existing extension modules and existing C code in the Python<br>&gt;&gt; interpreter<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; have no idea of any PyXXX_ calls, so I don't understand how
<br>&gt;&gt; new API<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; functions help here.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; The calls get added to pymalloc and PyMem_*() under the hood, so that<br>&gt;&gt; existing extension modules use the memory check automatically
<br>&gt;&gt; without a<br>&gt;&gt; change.&nbsp;&nbsp;The calls are just there in case some one has some random<br>&gt;&gt; need<br>&gt;&gt; to do their own malloc but still want to participate in the cap.<br>&gt;&gt; Plus<br>&gt;&gt; it helped me think everything through by giving everything I would
<br>&gt;&gt; need<br>&gt;&gt; to change internally an API.<br>&gt;<br>&gt; This confused me a bit, too. It might help if you annotated each of<br>&gt; the new<br>&gt; API's with who the expected callers were:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- trusted interpreter
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- untrusted interpreter<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- embedding application<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;- extension module<br><br>Threading is definitely going to be an issue with multiple<br>interpreters (restricted or otherwise)... for example, the PyGILState
<br>API probably wouldn't work anymore.</blockquote><div><br><br>PyGILState won't work because there are multiple interpreters period, or because of the introduced distinction of untrusted and trusted interpreters?&nbsp; In other words, is this some new possible breakage, or is this an issue with threads that has always existed with multiple interpreters?
<br><br>-Brett<br></div><br></div>