[Tutor] Threads

Willi Richert w.richert@gmx.net
Mon, 13 Aug 2001 23:18:58 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0036_01C1244E.548780A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

no reading in threading with Python, but some experience (bad!) I had =
with
Win98 and Python:
As I moved from  SocketServer.TCPServer to =
SocketServer.ThreadingTCPServer I
got strange errors which showed that I got no socket connection in the
ThreadingTCPServer-class. With SocketServer.TCPServer everything worked
fine. Also under W2K everything worked. I tried my script using cygwin =
and
got:

$ python gameserver.py
Traceback (most recent call last):
  File "gameserver.py", line 438, in ?
    import threading
  File "/usr/lib/python2.1/threading.py", line 18, in ?
    _start_new_thread =3D thread.start_new_thread
AttributeError: 'thread' module has no attribute 'start_new_thread'

=3D=3D=3D=3D> So don't use Win98 to learn thread programming with =
Python! Even W2K
is not the best ;-(
Play with Linux: If your script shows an error, you can only blame =
yourself
than  -  and learn ;-)

willi
PS: But for the hint's sake: Use threading instead of thread.


----- Original Message -----
From: A <printers@sendme.cz>
To: <tutor@python.org>
Cc: <activepython@listserv.ActiveState.com>
Sent: Monday, August 13, 2001 10:45 PM
Subject: [Tutor] Threads


> Hi,
>
> I am a newbie with Python.I want to use threads in my application.
> Can you please let me know what is the best way of programming
> threads under Win32 systems?
> What modules shall I use?
> Is it better to use the thread module or the threading module or the
> stackless Python? What are differences?
> Can you please give any example?
>
> Thanks for help.
> Ladislav
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>


------=_NextPart_000_0036_01C1244E.548780A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,<BR><BR>no reading in threading with =
Python, but=20
some experience (bad!) I had with<BR>Win98 and Python:<BR>As I moved =
from&nbsp;=20
SocketServer.TCPServer to SocketServer.ThreadingTCPServer I<BR>got =
strange=20
errors which showed that I got no socket connection in=20
the<BR>ThreadingTCPServer-class. With SocketServer.TCPServer everything=20
worked<BR>fine. Also under W2K everything worked. I tried my script =
using cygwin=20
and<BR>got:<BR><BR>$ python gameserver.py<BR>Traceback (most recent call =

last):<BR>&nbsp; File "gameserver.py", line 438, in =
?<BR>&nbsp;&nbsp;&nbsp;=20
import threading<BR>&nbsp; File "/usr/lib/python2.1/threading.py", line =
18, in=20
?<BR>&nbsp;&nbsp;&nbsp; _start_new_thread =3D=20
thread.start_new_thread<BR>AttributeError: 'thread' module has no =
attribute=20
'start_new_thread'<BR><BR>=3D=3D=3D=3D&gt; So don't use Win98 to learn =
thread=20
programming with Python! Even W2K<BR>is not the best ;-(<BR>Play with =
Linux: If=20
your script shows an error, you can only blame yourself<BR>than&nbsp; =
-&nbsp;=20
and learn ;-)<BR><BR>willi<BR>PS: But for the hint's sake: Use threading =
instead=20
of thread.<BR><BR><BR>----- Original Message -----<BR>From: A &lt;<A=20
href=3D"mailto:printers@sendme.cz">printers@sendme.cz</A>&gt;<BR>To: =
&lt;<A=20
href=3D"mailto:tutor@python.org">tutor@python.org</A>&gt;<BR>Cc: &lt;<A=20
href=3D"mailto:activepython@listserv.ActiveState.com">activepython@listse=
rv.ActiveState.com</A>&gt;<BR>Sent:=20
Monday, August 13, 2001 10:45 PM<BR>Subject: [Tutor] =
Threads<BR><BR><BR>&gt;=20
Hi,<BR>&gt;<BR>&gt; I am a newbie with Python.I want to use threads in =
my=20
application.<BR>&gt; Can you please let me know what is the best way of=20
programming<BR>&gt; threads under Win32 systems?<BR>&gt; What modules =
shall I=20
use?<BR>&gt; Is it better to use the thread module or the threading =
module or=20
the<BR>&gt; stackless Python? What are differences?<BR>&gt; Can you =
please give=20
any example?<BR>&gt;<BR>&gt; Thanks for help.<BR>&gt; =
Ladislav<BR>&gt;<BR>&gt;=20
_______________________________________________<BR>&gt; Tutor =
maillist&nbsp;=20
-&nbsp; <A href=3D"mailto:Tutor@python.org">Tutor@python.org</A><BR>&gt; =
<A=20
href=3D"http://mail.python.org/mailman/listinfo/tutor">http://mail.python=
.org/mailman/listinfo/tutor</A><BR>&gt;<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0036_01C1244E.548780A0--