[wxPython] wxPython threading demo revisited

Hi,

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.

Regards,

Harri

···

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

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?

···

--
-- David
--
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l@fitlinxx.com /
  > FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

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?

--
-- David
--
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l@fitlinxx.com /
  > FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

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>

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

"Drew Whitehouse" <Drew.Whitehouse@anu.edu.au> writes:

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.

···

--
-- David
--
/-----------------------------------------------------------------------\
\ David Bolen \ E-mail: db3l@fitlinxx.com /
  > FitLinxx, Inc. \ Phone: (203) 708-5192 |
/ 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
\-----------------------------------------------------------------------/

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

Yelp seen this.
Here's a copy of a previous post.

If you happen to have more than one CPU give this a try on Windows.

import win32process
import win32api
win32process.SetProcessAffinityMask(win32api.GetCurrentProcess(), 1)

My multi threaded app on Win2k crashes when run with more than one CPU.
Unless I limit it to just one.

--Darrell

The problem is that while this works perfectly on a uni-processor machine,

on a

···

----- Original Message -----
From: "Harri Pasanen" <harri.pasanen@wanadoo.fr>

dual-processor Pentium III it crashes after a while both with Linux and
Windows-NT, usually with 'Invalid tstate'.

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

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>

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users

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...

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users