LWN.net Logo

Various notes, all about Python

Various notes, all about Python

Posted Sep 7, 2006 9:11 UTC (Thu) by dale77 (guest, #1490)
Parent article: Various notes, all about Python

Hmmm. An interesting experiment to try @ home.

dale@gordon:~$ python
Python 2.4.3 (#1, May 13 2006, 20:51:04)
[GCC 4.0.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

dale@gordon:~/blfs-sources/strace-4.5.14$ strace -p $(pidof python)
Process 7611 attached - interrupt to quit
read(0,

Um. Excuse me, its just sittin' there. No 10 wakes per second on this box.
Perhaps it's because I built it myself, rather than running RedHat? Is my
build broken because my python appears not to suck?

What's up?

Dale


(Log in to post comments)

Various notes, all about Python

Posted Sep 7, 2006 9:50 UTC (Thu) by cortana (subscriber, #24596) [Link]

Possibly. I just tried it on my Debian machine and observed a constant stream of select system calls.

Various notes, all about Python

Posted Sep 7, 2006 9:52 UTC (Thu) by nduboc (subscriber, #23707) [Link]

I tested on my Debian testing/unstable box and reproduce the select flood with python2.4 but not with python2.3.

--
Nico

Various notes, all about Python

Posted Sep 7, 2006 10:15 UTC (Thu) by dale77 (guest, #1490) [Link]

I suppose the fact that it seems to be good on my LFS system could be due
to a fix in readline for LFS. When you build LFS the readline source is
patched, as the LFS book says:

Upstream developers have fixed several issues since the initial release of
Readline-5.1. Apply those fixes:
patch -Np1 -i ../readline-5.1-fixes-3.patch

Dale

Various notes, all about Python

Posted Sep 7, 2006 10:23 UTC (Thu) by shane (subscriber, #3335) [Link]

The article indicates that the problem is from the readline library. If
your Python is not complied with the readline library, you would not see
this behavior.

A simple test would be to hit "ctrl-R" and see if the interpreter asks for
a "reverse-i-search". If it does, then you are using readline, if not,
then probably not.

Various notes, all about Python

Posted Sep 7, 2006 10:34 UTC (Thu) by dale77 (guest, #1490) [Link]

Ctrl-R reports (reverse-i-search) so on your authority readline appears to
be in there. As expected really, because python is not part of the base
LFS build, while readline is.

Dale

Various notes, all about Python

Posted Sep 7, 2006 12:34 UTC (Thu) by Dom2 (guest, #458) [Link]

Is your version of python built with threading turned on? If not, you probably won't see it.

Various notes, all about Python

Posted Sep 8, 2006 10:19 UTC (Fri) by dale77 (guest, #1490) [Link]

I would have built it like this:

./configure --prefix=/usr --enable-shared &&
make

Various notes, all about Python

Posted Sep 7, 2006 13:33 UTC (Thu) by amk (subscriber, #19) [Link]

See the Python bug report. The select() code is only used with readline 2.1; more recent versions of readline use different interface code.

Various notes, all about Python

Posted Sep 14, 2006 18:00 UTC (Thu) by dag- (subscriber, #30207) [Link]

The Red Hat bugzilla report Jeff Waugh refered to, is not related to his findings of the python interactive shell.

In fact, Fedora or Red Hat (at least since Red Hat 7.2) do not have the readline <= 2.1 related problem Jeff found. Even Red Hat 7.2 comes with readline 4.2.

So Red Hat or Fedora is not affected by this 100ms wake-up issue, so maybe Python *is* ready for the enterprise, but Jeff's distribution is not ? :-)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds