Unusual minidom behaviour: Part Deux

Victor Bazarov vAbazarov at dAnai.com
Fri Jul 27 11:30:59 EDT 2001


"Martin von Loewis" <loewis at informatik.hu-berlin.de> wrote...
> "Victor Bazarov" <vAbazarov at dAnai.com> writes:
>
> > The system that tries to use some XML files is written in Python
> > and is being run from under a Java application.  In the system
> > something (that looks like a deadlock) happens when two threads
> > both need to parse (each its own) XML file.
>
> When you say "thread" here, do you mean "Java thread" or "Python
> thread"? I assume you mean "Java thread", since you did not indicate
> at all that you are using threads in your Python application.

Don't assume.  I don't mean Java thread, otherwise I would be
asking in a Java forum.

> Note that when you call Java's Runtime.exec, you create a new
> operating system process. So when two Java threads simultaneously
> invoke Runtime.exec, you end up with two operating system processes,
> each running a separate Python interpreter - not with a single Python
> interpreter running two threads.
>
> Can you please confirm that this is the situation you are confronted
> with?

No, sorry, I can't confirm.  It's one Python interpreter running
multi-threaded Python application.  I do believe the problem to be
with Python multithreading code (and not even with our Python code).

Why it shows up when run under Java, I don't know.  But symptoms
are very similar to what was talked about in another thread (no
pun intended) here.  See "Threads in Python version 1.5, thread
doesn't start until calling process dies".

> > Both call 'parse' from 'minidom' package, which leads to an attempt
> > to __import__ the xml.sax.expatreader.
>
> Assuming that [...]

Thanks.  Wrong assumption, though.

Victor
--
Please remove capital A's from my address when replying by mail





More information about the Python-list mailing list