A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20060720/d60aea40/attachment.htm below:

<br><br><div><span class="gmail_quote">On 7/20/06, <b class="gmail_sendername">Giovanni Bajo</b> &lt;<a href="mailto:rasky@develer.com">rasky@develer.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Brett Cannon wrote:<br><br>&gt;&gt;<br><a href="http://svn.python.org/view/python/branches/bcannon-sandboxing/securing_python.txt?rev=50717&amp;view=log">http://svn.python.org/view/python/branches/bcannon-sandboxing/securing_python.txt?rev=50717&amp;view=log
</a><br>&gt;&gt; .<br>&gt;&gt;<br>&gt;&gt; How do you plan to handle CPU-hogs? Stuff like execution of a<br>&gt;&gt; gigantic integer multiplication.<br>&gt;<br>&gt;<br>&gt; I don't.&nbsp;&nbsp;=)&nbsp;&nbsp;Protecting the CPU is damn hard to do in any form of
<br>&gt; portable fashion.&nbsp;&nbsp;And even getting it to work on an OS you do know<br>&gt; the details of leads to probably an interrupt&nbsp;&nbsp;implementation and<br>&gt; that doesn't sound fun.<br><br>I think the trick used by the safe_eval recipe (a separate thread which
<br>interrupts the script through thread.interrupt_main()) shows that, in most<br>cases, it's possible to make sure that an embedded script does not take too<br>long to execute. Do you agree that this usage case (&quot;allow me to timeout an
<br>embedded script&quot;) is something which would be a very good start in the right<br>direction?</blockquote><div><br>Probably.&nbsp; I just don't feel like worrying about it right now.&nbsp; =) <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now, I wonder, in a restricted execution environment such as that depicted<br>in your document, how many different ways are there to make the Python<br>interpreter enter a long calcolation loop which does not release the GIL? I
<br>can think of bignum*bignum, bignum**bignum or similar mathematical<br>operations, but there are really a few. If we could make those release the<br>GIL (or poll some kind of watchdog used to abort them, pretty much like they
<br>normally poll CTRL+C), then the same trick used by the recipe could be used.</blockquote><div><br>Well, any work that does most of its calculation within C code and that does not touch base with the interpreter on a semi-regular basis would need to relesae the GIL.
<br><br>-Brett<br></div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4