Fiber implementation questions

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 20 09:00:04 PDT 2016


Am 20.06.2016 um 17:43 schrieb Ilya Yaroshenko:
> Hello,
>
> I am thinking about faster event loop that vibe.d has (does not matter
> what driver are used). I want to implement (at least DIP) advanced Fiber
> yielding loop that can allow to eliminate context switching for all kind
> of event waiters.

I'm currently working on a successor of vibe.d's core module [1], which 
is more or less an internal rewrite to yield maximum performance. The 
vibe.d side definitely plays a part there, but most of the improvements 
are based on a rewritten event loop abstraction [2], which gives roughly 
a 3x speedup over both, libevent and libasync*, for a simple HTTP server 
request benchmark. This event loop abstraction is currently just a proof 
of concept and still experimental, though.

>
> Q1: Is it save to detach Fiber context from one thread and attach it to
> another thread?

It will at least always break TLS variables in one way or another.

[1]: https://github.com/vibe-d/vibe-core
[2]: https://github.com/vibe-d/eventcore

* May have changed in the past weeks/months


More information about the Digitalmars-d mailing list