Microthreads without Stackless?

M.E.Farmer mefjr75 at hotmail.com
Wed Sep 15 21:55:07 EDT 2004


> And, to put it provocatively, David Mertz got it wrong.
> 
> As Mertz notes, generators can only transfer control to their
> immediate callers.  His solution of always calling them from a
> scheduler is no solution at all; they still only transfer to
> their immediate caller, and that caller is further restricted to
> be the scheduler.
> 
> Mertz's pattern provides nothing like real co-routines or
> threads, and the reliance on a scheduler has essentially nothing
> to do with that.  Real co-routines or threads can yield from
> anywhere.  Most importantly, they yield when calling for I/O.
> The call-depth could be any; the import point is that whenever
> one routine blocks to wait for an event, other routines can
> still run.


Wow!,
    Provocative = Tending to provoke or stimulate.
    Well, since you are trying to provoke/stimulate me!
Did a little search with Google:
'http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&q=author:bryanjugglercryptographer%40yahoo.com+'
'http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&q=author:fakeaddress%40nowhere.org+'

I noticed you tend to be quite critcal of others.

"""Bryon wrote:
We've been over this before.  My position, in case you've
forgotten:

     There is a dilemma in how to respond to the piles of
     garbage. Lots of newbies do read the group, and they might
     not be able to filter out all the trash.

     I've decided one reasonable way to respond to a flood of
     nonsense is to call it what it is, and suggest that the
     author put forth effort to write good posts instead.
"""
Excellent comment I agree!
I suggest that you put forth effort to write good posts,
instead of trying to wear people down with your opinions and/or tired
arguments.

Did you notice the OP asked for:
    microthreads
    using generators and threads
    The devil, however, is in the scheduler's details

What I posted was about as close as you get.
    'Implementing "weightless threads" with Python generators.'
    I have not studied or used that code.
    I hoped it would be of use as inspiration for his scheduler.
    If nothing else it would show how not to do it.
    Mertz never said they were like real threads or coroutines.
    Where did you get that?
    I know it breaks your heart there aren't coroutines in Python.
    But get a grip on reality. 
    We have got generators(semi-coroutines),
    and others have mentioned it **is** doable.
You did notice this:
    P.S. The Candygram package is an implementation of
    Erlang concurrency primitives within Python.


So you been there, done that huh?
'http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=dSDVc.9181%249R.1949%40newssvr27.news.prodigy.com&rnum=24&prev=/groups%3Fq%3Dauthor:fakeaddress%2540nowhere.org%26start%3D20%26hl%3Den%26lr%3D%26ie%3DUTF-8%26selm%3DdSDVc.9181%25249R.1949%2540newssvr27.news.prodigy.com%26rnum%3D24'

"""
Dominic wrote:
> Well, the Erlang (language + telecom platform) uses light-weight
> threads which could e.g. be implemented with coroutines in Python.
Bryon wrote:
Well, the issue here is whether they could be implemented
reasonably in Python as it currently is, with generators 
but not co-routines.
"""
Why didn't you post a link to the other thread?
Did you notice the other people that responded are the ones from the
other thread?
Did you notice they actually gave links to code?
Did you email David Mertz and tell him he was 'wrong'?
Did you make an effort to 'correct' Mertz's 'mistake'?
Did you write code to get it right?
Did you responded in a helpful way or did you just waste time?

Since you gave me your opinion I will share mine.

I am going to suggest you try one or more of the following:
    Get a real email... quit using FAKEADDRESES.
                        Your smart get a free web email or/and filter.
    Write some code...  Maybe an implementation of coroutines
                        for python, so we can be enlightned!
    Take a walk...And think about all the comments you make, 
                  in all the groups you post in ,
                  then think about what it really says about you.
                  what if you had used your intelligent mind to help,
                  rather than offend, argue, and debate?
    Get a job or two or three...
                  You have way to much 'copious free time',
                  left to post your nonsense to so many groups.
    Read a book...Like the Bible or other religous text.
                  Your angst stems from the fact you 
                  are at odds with your creator.
                  Yes, I realise you are an athiest.
                  We have all been wrong before.

"""Sure nailed that one, didn't I?
(With a little help from Google.)
"""  
HTH, 
    M.E.Farmer :)



More information about the Python-list mailing list