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. Need a name .. we have s channels and p channels perhaps these are ps-channels? :-) -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis & security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language