Lets talk about fibers

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 4 05:53:48 PDT 2015


On 03-Jun-2015 21:34, Liran Zvibel wrote:
> Hi,
>
[snip]

> There are two main reasons why it does not make sense to move fibers
> between threads:
>

For me language being TLS by default is enough to not even try this 
madness. If we allow moves a typical fiber will see different "globals" 
depending on where it is scheduled next.

For instance, if a thread local connection is used (inside of some pool 
presumably) then:

Socket socket;

first_part = socket.read(...); // assume this yields
second_part = socket.read(...); // then this may use different socket



-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list