[Tutor] about threads

anil maran anilmrn at yahoo.com
Thu Aug 17 11:19:08 CEST 2006


You'll have to write multi-threaded code if you want it to run multiple 
threads :)
(Unless, of course, Web.py supports threads?)
Luke, what is the easiest way to run multithreaded programs from webpy
is there a page that has common gotchas and pitfalls for doing the same.


Luke Paireepinart <rabidpoobear at gmail.com> wrote: emilia12 at mail.bg wrote:
> Hi all,
>   
Hi!
> my question is probably about the threads... I have two IPs
> and i want to run web.py server for each IP in the same
> time from one script file. I can run them in two command
> boxes (and this works) but i want to do this from one ;-)
>
>   
if you run two instances of the python interpreter (like you're doing 
when you start two command windows,)
they're executing in different threads, it's just that the threads are 
OS level instead of application level.
Windows automatically switches between the two instances of the 
interpreter and gives them both time to do something.
This is why you can run an E-mail application at the same time as your 
web browser.
I suspect that OS-level threading in this way would be more efficient in 
regard to speed, but
it'd use more RAM because two interpreter instances would be loaded into 
memory at the same time.
I don't know what web.py is.
Is it something you wrote?
You'll have to write multi-threaded code if you want it to run multiple 
threads :)
(Unless, of course, Web.py supports threads?)
What's your experience with Python?
Do you need help with threads in general? threads in Python?
 >Maybe i can do this with 'threads' but how ? is there some
 >example ??
There are plenty of examples of threaded code that you could find by 
googling around,
or do you mean 'is there some example [of multi-threading the web.py 
program]??'
If the latter case, I guess you could find that by googling as well, if 
it exists.

> regards
> e.
>   

Cheers,
-Luke
_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor


 		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060817/dbaeb6b4/attachment.htm 


More information about the Tutor mailing list