Hi all,
This is the first i post in this newsgroup, i hope my english is not too
bad...
Let's get straight to the point ! I have a little probleme using threads in
my little training example :
I wish to create two threads in my application, one thread (the subject)
will increment a variable, and a
I think it is more suitable in this form...
from threading import *
class Subject(object):
def __init__(self) :
self.counter = 0
t = Timer(0.1,self.doIteratingStuff)
t.start()
def incrementCounter(self,n=1) :
Hi everybody,
"Daniel Bickett" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Instead of having the Controller query the Subject (not exactly
> plausible), I had it wait for a signal (threading.Event) as set by the
> Subject. You could also have it query a queue, as that
"M.E.Farmer" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Just a warning!
> Threads and newbies don't mix well,
> many pitfalls and hard to find bugs await you.
> I would avoid using threads if at all possible.
Indeed :). But how will i learn using threads if i avoid
Hi,
I fixed the code, it runs under Linux but not under windows 0_o ??! i guess
windows and Linux do not handle threads the same way.
However, i don't have the result i excpect.
Please have a look here :
## In this little program, i'm trying to find a way to yield data from a
thread within anot
"M.E.Farmer" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> What did you expect? This is what it did on win 2000/python 2.2.3
> ##> controller waiting... 0 loops
> ##> controller waiting... 1 loops
> Subject : the counter is now 0
> ##> controller waiting..
"Steve Holden" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Could be the OP is using Cygwin, which won't support threading by
> default and will give very confusing results
>
> just-a-guess-ly y'rs - steve
Nice try :), but nope :).
Yacine Chaouche -- France.
--
h