Fibers talk by Mikola Lysenko

Jarrett Billingsley jarrett.billingsley at gmail.com
Sun Oct 5 07:29:35 PDT 2008


On Sun, Oct 5, 2008 at 8:25 AM, downs <default_357-line at yahoo.de> wrote:
> Jarrett Billingsley wrote:
>> On Sat, Oct 4, 2008 at 8:14 AM, bearophile <bearophileHUGS at lycos.com> wrote:
>>> Mikola Lysenko:
>>>> http://team0xf.com/conference/fibers.pdf
>>> Very nice, few simple comments:
>>> - In Python you have yield, but it can also take parameters, so the two coroutines can send messages to each other all the time. I presume this is possible with those fibers too.
>>
>> It's a matter of subclassing Fiber and adding whatever capabilities to
>> it that you want.  I think Daniel Keep did something along these lines
>> but I can't find any code..
>>
>>> - A few benchmarks to compare the performance of fibers compared to normal plain subroutines (and opApply) can be useful.
>>
>> They're fast.  Very fast.  But you're obsessed with benchmarks so
>> that's probably not enough for you.
>>
>>> - If programmers start using fibers often, then can it become positive for the compiler to be aware of them, to optimize code better? (especially when they are used where they aren't necessary).
>>
>> Yes, this was discussed.  If the compiler becomes aware of fiber
>> switches, it can generate more efficient code as it knows which
>> registers have to be saved or not.  It can also get rid of them
>> entirely if possible.
>
> I'm not sure how fast Tango's fibers are.
>
> Tools' fibers are a few milliseconds per context switch on an unpatched phobos.
>
> On a patched phobos, that goes down to a few hundred processor cycles. :)

Tango's fiber switches are on the same order.


More information about the Digitalmars-d-announce mailing list