concurrency program design stackless python tasklet or python thread?

James Mills prologic at shortcircuit.net.au
Tue Nov 11 01:36:25 EST 2008


On Tue, Nov 11, 2008 at 3:57 PM, davy zhang <davyzhang at gmail.com> 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.
>
> 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?

You could try circuits [1] - An event driven way
to concurrency.

--JamesMills

[1] http://trac.softcircuit.com.au/circuits/

-- 
--
-- "Problems are solved by method"



More information about the Python-list mailing list