global interpreter lock

Mike Meyer mwm at mired.org
Mon Aug 29 20:19:11 EDT 2005


Bryan Olson <fakeaddress at nowhere.org> writes:
> Mike Meyer wrote:
>  > Bryan Olson writes:
>  > phil hunt wrote:
>  >> > What's important is *predictability*, e.g. which instruction will
>  >> > the computer execute next?
>  >> > If you only have one thread, you can tell by looking at the code
>  >> > what gets executed next. It's very simple.
>  >>Not really. Trivially, an 'if' statement that depends upon input
>  >>data is statically predictable. Use of async I/O means makes the
>  >>programs execution dependent upon external timing.
>  > Yes, but that depenency is tied to a single point - the select
>  > call. The paths after that are statically predictable. This makes the
>  > code very managable.
> Wow -- I could not disagree more. Returning back to some single
> point for every possibly-blocking operation is painful to manage
> even for simple GUIs, and humanly intractable for sophisticated
> services.

I'd be interested in what you're trying to do that winds up as
unmanagable. There are clearly things select+async IO is unsuitable
for. You may be running into problems because you're trying to use it
in such an environment. For instance, it's not clear to me that it
will work well for any kind of GUI programming, though I've had good
look with it for command line interfaces.

> Select is certainly useful, but it scales badly and isn't as
> general as better tools.

It can't take advantage of multiple CPUs. I've not run into scaling
problems on single-CPU systems.

>  > [...] I'm calling the tools available in most programming
>  > languages for dealing with it primitive.
>  > We need better tools.
> Agreed, but if 'select' is someone's idea of the state of the
> art, they have little clue as to the tools already available.

Well, share! If you know of tools that make dealing with concurrent
code more manageable than an async I/O loop and have fewer
restrictions, I'm certainly interested in hearing about them.

> Bringing the tools to Python remains a bit of challenge, largely
> because so many Pythoners are unaware.

Well, the way to fix that is to talk about them!

      <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list