<html>
<head>
</head>
<body>
Here is the official word on free threaded Python from Greg Stein,<br>
which was obtained offlist.<br>
<br>
Greg Stein wrote:<br>
<blockquote type="cite" cite="mid:20020828050349.D8643@lyra.org">
<pre wrap="">On Wed, Aug 28, 2002 at 01:15:10AM -0400, Aaron Watters wrote:<br></pre>
<blockquote type="cite">
<pre wrap="">(I copy Greg Stein so he can correct my misstatements)<br><br>Simon Frost wrote:<br><br></pre>
<blockquote type="cite">
<pre wrap="">Dear Chris and Aaron...<br>I'm referring to your test programs. When I run them on a dual <br>processor machine, the load is balanced between them. <br></pre>
</blockquote>
<pre wrap="">IO operations release the interpreter lock... if you have enough of them <br>compared<br>to interpreter computations you might get a balanced load. Maybe that is <br>what is happening....<br></pre>
</blockquote>
<pre wrap=""><!----><br>That could definitely explain a balance, yes.<br><br></pre>
<blockquote type="cite">
<pre wrap="">...<br>For "free threaded python" Greg Stein found that you'd have to allocate <br>a lock<br>for every list and get and release it for many list operations, <br>etcetera. This ate up the hypothetical<br>advantage of using threads on most systems :(, I think.<br></pre>
</blockquote>
<pre wrap=""><!----><br>Yah. Python ran somewhere between 30 and 50 percent slower overall. I never<br>looked into it hard enough. I believe a good amount was lock contention on<br>some central resources. The individual objects' locks were fast.<br><br></pre>
<blockquote type="cite">
<pre wrap="">For stackless I would head this way (maybe): use channels as the only <br>communication mechanism<br>and then develop some sort of a safe (and fast) way to share channels <br>between<br>processes. Then you could balance the microthreads between a number of <br>processes (maybe).<br></pre>
</blockquote>
<pre wrap=""><!----><br>Yup. To expand the concept a bit, if I were to ever do the free-threading<br>stuff again, I would add a flag to the relevant objects. If the flag is set,<br>then access is synchronized. When the flag is clear, then it can operate at<br>full speed. Another, somewhat orthogonal flag is a "read only" flag. That<br>would shut down all mutex handling, even on shared data items.<br><br>Cheers,<br>-g<br><br></pre>
</blockquote>
<br>
</body>
</html>