Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > concurrency program design stackless python tasklet or python thread?

Reply
Thread Tools

concurrency program design stackless python tasklet or python thread?

 
 
davy zhang
Guest
Posts: n/a
 
      11-11-2008
first here is my basic idea is every actor holds their own msg queue,
the process function will handle the message as soon as the dispatcher
object put the message in.

This idea naturally leads me to place every actor in a separate thread
waiting for msg

but the rumor has it, stackless python with tasklet and channel can do
much more better in concurrency program, so I dive my head into it.

but I found the tasklet is really a lined-up sequence , that means if
a tasklet blocked or do some time consuming calculation, the other
tasklets can not get the cpu slice

so we must design very carefully to avoid the big job for single task

I am just confused why the stackless python is said to be good at
concurrency program model or just I get a wrong idea to practice?
 
Reply With Quote
 
 
 
 
Aahz
Guest
Posts: n/a
 
      11-11-2008
In article <mailman.3787.1226383071.3487.python->,
davy zhang <> wrote:
>
>first here is my basic idea is every actor holds their own msg queue,
>the process function will handle the message as soon as the dispatcher
>object put the message in.


Sounds like a standard design.

>This idea naturally leads me to place every actor in a separate thread
>waiting for msg
>
>but the rumor has it, stackless python with tasklet and channel can do
>much more better in concurrency program, so I dive my head into it.
>
>but I found the tasklet is really a lined-up sequence , that means if
>a tasklet blocked or do some time consuming calculation, the other
>tasklets can not get the cpu slice
>
>so we must design very carefully to avoid the big job for single task
>
>I am just confused why the stackless python is said to be good at
>concurrency program model or just I get a wrong idea to practice?


Well, you have to be a bit careful, but Stackless is definitely one good
approach to handling your design. For example, EVE Online is an MMORPG
written in Python with a similar design. That said, I personally have
trouble wrapping my brain around Stackless, so I'd probably choose a
different technique.
--
Aahz () <*> http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tasklet library based on PEP 0342 charlie137@gmail.com Python 4 01-20-2009 02:57 AM
Re: concurrency program design stackless python tasklet or pythonthread? davy zhang Python 0 11-13-2008 03:28 AM
Re: concurrency program design stackless python tasklet or pythonthread? Aleksandar Radulovic Python 0 11-11-2008 04:10 PM
RE: Python in Games (was RE: [Stackless] Python in Games) Delaney, Timothy C (Timothy) Python 3 06-15-2005 04:08 PM
stackless python: continuation module? TheDustbustr Python 2 08-06-2003 05:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57