How many std.concurrency receivers?

Sean Kelly sean at invisibleduck.org
Sun Oct 14 18:58:27 PDT 2012


On Oct 14, 2012, at 9:59 AM, Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:

> On 14-Oct-12 20:19, Sean Kelly wrote:
>> On Oct 12, 2012, at 2:29 AM, Russel Winder <russel at winder.org.uk> wrote:
>> 
>>> On Thu, 2012-10-11 at 20:30 -0700, Charles Hixson wrote:
>>> […]
>>>> I'm not clear on what Fibers are.  From Ruby they seem to mean
>>>> co-routines, and that doesn't have much advantage.  But it also seems as
>>> […]
>>> 
>>> I think the emerging consensus is that threads allow for pre-emptive
>>> scheduling whereas fibres do not. So yes as in Ruby, fibres are
>>> collaborative co-routines. Stackless Python is similar.
>> 
>> Yep. If fibers were used in std.concurrency there would basically be an implicit yield in send and receive.
> 
> Makes me wonder how it will work with blocking I/O and the like. If all of (few of) threads get blocked this way that going to stall all of (thousands of) fibers.

Ideally, IO would be nonblocking with a yield there too, at least if the operation would block. 


More information about the Digitalmars-d-learn mailing list