Il giorno lunedì 3 marzo 2014 03:52:15 UTC+11, skaller ha scritto:
>
> Now a refresher. 
>
> Why can't you do sych I/O or async I/O in a function? 
> I mean reading from an schannel or socket naturally 
> IS a function (even if writing isn't). Or at least a generator! 
>
> The reason again: these operations block fthreads. To do that, 
> the fthread has yield, and a pointer to it put onto some list 
> so another fthread can become current. 
>
> The problem is you can't have a pointer to the machine stack, 
> or anything closed over it, and swap it for another pointer, 
> to exchange control. 
>
> Actually you CAN do this: you use a pthread and a lock. 
> Pthreads are the natural way to swap machine stacks. 
>
> So actually you CAN use pchannels in generators. 
>
> ============= 
>
> Note to self: pchannels BLOCK the whole pthread. 
> Which means there's no way to send message between 
> fibres on different pthreads. 
>
> But clearly this can be done with async I/O machinery, 
> which allows *suspending* a fibre while it waits for 
> asynchronous service .. which is exactly how communication 
> across pthread boundaries looks. 
>
> So we really need to be able to do this.  Interestingly this 
> would work fine within the same pthread too. 
>

Interesting!
 
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to