Looks to me that wxPython is thrashing Python's threading structs at some point.
It may be that the fault lies at SWIG, haven't yet had time to delve in deeper.
I rewrote the Threads.py sample to be fully thread safe, and not to use any
UI calls than those from the main threads. I did this by replacing the
wxPostEvent with a wxTimer and a Queue.
The problem is that while this works perfectly on a uni-processor machine, on a
dual-processor Pentium III it crashes after a while both with Linux and
Windows-NT, usually with 'Invalid tstate'.
Any ideas of the bat? I'll try to find time to hunt down these, as they are
showstoppers for an application proto I had in mind.
Looks to me that wxPython is thrashing Python's threading structs at
some point. It may be that the fault lies at SWIG, haven't yet had
time to delve in deeper.
I rewrote the Threads.py sample to be fully thread safe, and not to use any
UI calls than those from the main threads. I did this by replacing the
wxPostEvent with a wxTimer and a Queue.
Hmm, I've got a multi-threaded application (wxPython 2.2.1 under NT)
that is using wxPostEvent from multiple worker threads (with all
actual UI operations from the main GUI thread) that works fine. I
have run into some issues with memory leaks which I noted here a while
back (it got much better in 2.2.1 than earlier versions), but I've
never had a crash, even over long runtimes.
It's my understanding (and I believe I looked at the code in the past)
that using wxPostEvent from within a worker thread should be perfectly
thread safe.
Is this with wxPython 2.2.2 or some other version?
The key here is *multiple cpu's*. I get the same behaviour under 2xCPU NT4,
very quickly.
-Drew
···
----- Original Message -----
From: "David Bolen" <db3l@fitlinxx.com>
To: <wxpython-users@lists.sourceforge.net>
Sent: Tuesday, November 28, 2000 12:07 PM
Subject: Re: [wxPython] wxPython threading demo revisited
Harri Pasanen <harri.pasanen@wanadoo.fr> writes:
> Looks to me that wxPython is thrashing Python's threading structs at
> some point. It may be that the fault lies at SWIG, haven't yet had
> time to delve in deeper.
>
> I rewrote the Threads.py sample to be fully thread safe, and not to use
any
> UI calls than those from the main threads. I did this by replacing
the
> wxPostEvent with a wxTimer and a Queue.
Hmm, I've got a multi-threaded application (wxPython 2.2.1 under NT)
that is using wxPostEvent from multiple worker threads (with all
actual UI operations from the main GUI thread) that works fine. I
have run into some issues with memory leaks which I noted here a while
back (it got much better in 2.2.1 than earlier versions), but I've
never had a crash, even over long runtimes.
It's my understanding (and I believe I looked at the code in the past)
that using wxPostEvent from within a worker thread should be perfectly
thread safe.
Is this with wxPython 2.2.2 or some other version?
The key here is *multiple cpu's*. I get the same behaviour under 2xCPU NT4,
very quickly.
Ah - I read the original post to say that he was fixing the module to
get it working at all, but then it still continued to have problems in
the multi-CPU environment. So I was interested if it's something I
might run up against in the standard environment.
I started to take a look at this, but stumbled to a much more basic problem...
How do you just rebuild an object file? I removed helpers.o, but
'python setup.py build' will not rebuild it, and there doesn't seem to be any
makefile.
Not so familiar with dist-utils... But by the name it sounds more like for
distribution. How about development?
-Harri
···
On Tue, 28 Nov 2000, Robin Dunn wrote:
>
> The key here is *multiple cpu's*. I get the same behaviour under 2xCPU
NT4,
> very quickly.
>
So, anybody have an SMP machine they can send me? <wink>
I started to take a look at this, but stumbled to a much more basic
problem...
How do you just rebuild an object file? I removed helpers.o, but
'python setup.py build' will not rebuild it, and there doesn't seem to be
any
makefile.
For some reason distutils doesn't check intermediate dependencies, so in the
helpers.cpp --> helpers.o --> wxc.so chain it only checks timestamps on
helpers.cpp --> wxc.so. If you touch helpers.cpp then it should rebuild it.
Not so familiar with dist-utils... But by the name it sounds more like
for
distribution. How about development?
Once you get used to some of its quirks it's not too bad for development.
In some ways better than makefiles, in some ways worse...