Threading - will threads run in parallel?
- From: "SolaFide" <solafidefarms@xxxxxxxxx>
- Date: 28 Feb 2006 11:20:05 -0800
I have 2 threads that I want to run at the same time: for instance:
from threading import Thread
class test(Thread):
def run(self):
while True:
get(asdf)
class test2(Thread):
def run(self):
while True:
get(jkl)
ack=test()
jkl=test2()
ack.start()
jkl.start()
(get() is a function which waits for a ping on a specific port, thus
stopping the program for a while.)
Will these run together, or do I have to find some other way of running
in parallel?
Also, is it possible to split off a program for the terminal that
started it? As in I type in python test.py and test.py runs in the
background and lets me do other things in that terminal?
.
- Follow-Ups:
- Re: Threading - will threads run in parallel?
- From: Rene Pijlman
- Re: Threading - will threads run in parallel?
- From: Ido Yehieli
- Re: Threading - will threads run in parallel?
- Prev by Date: Re: sort one list using the values from another list
- Next by Date: Re: PEP 354: Enumerations in Python
- Previous by thread: telnetlib problems
- Next by thread: Re: Threading - will threads run in parallel?
- Index(es):
Relevant Pages
|