[Stackless] Santa concurrency problem
bzimmer at ziclix.com
Mon Mar 26 22:00:01 CEST 2007
On my linux workstation (2 cpu) I see stackless (my version) hover
around 49-50% cpu time as well. It does seem really high.
Interestingly, if I comment out the sleep call stackless cpu usage
drops to almost nothing.
On Mar 26, 2007, at 12:39 PM, Santiago Gala wrote:
> El lun, 26-03-2007 a las 15:46 -0300, Carlos Eduardo de Paula escribió:
>> Hello Brian,
>> Based on your code, I adapted it to an object oriented approach.. the
>> functionality is the same but it looks "cleaner" for me... :)
>> Its a great example and if you would permit, I can add it to the
>> stackless examples project. (Both approaches if you want).
>> The code is here: http://dpaste.com/hold/7433/
> Something I don't completely understand.
> I have not yet tested the haskell version ,but I did it with the erlang
> one, and both stackless versions.
> While the erlang version was not even noticeable in top, taking
> negligible CPU time, both stackless versions were spinning to 100% CPU
> (of one core, i.e. 50% system CPU time).
> Is that a bug in the stackless versions, in my setup, or what? given
> that modern CPUs are bound to shut down if too hot, and the the erlang
> looked faster to me, it looks like there is a bug either in stackless
> in the implementation.
>> Best regards,
>> On 3/25/07, Brian Zimmer <bzimmer at ziclix.com> wrote:
>>> I've been using Python for years but only recently started using
>>> Stackless. One of the current concurrency topics is the paper
>>> by Simon Peyton-Jones about STM in which he presents a concurrency
>>> problem and provides Haskell code to solve it. The Erlang list then
>>> included a version in Erlang demonstrating a shorter, and perhaps
>>> readable, solution to the problem. I'm including my Stackless
>>> as a comparison and also wish feedback on my use of Stackless since
>>> was my first stab at it. I was thrilled to see I could schedule 10K
>>> elves without a problem.
>>> The top of the Erlang code has a good description of the problem.
>>> Erlang: http://www.cs.otago.ac.nz/staffpriv/ok/santa/santa.erl
>>> Stackless: http://www.ziclix.com/software/santa.txt
>>> thanks, brian
>>> Stackless mailing list
>>> Stackless at stackless.com
>> Stackless mailing list
>> Stackless at stackless.com
> Stackless mailing list
> Stackless at stackless.com
Stackless mailing list
Stackless at stackless.com
More information about the Stackless