On 13/05/2012, at 12:24 AM, john skaller wrote: > > Anyhow, Felix shouldn't terminate with the writer still on the > fibre stack (the reader put it there when it read the channel).
Oh.. interesting. Very interesting!! At present the mainline runs a full scale fibre scheduler. When you're inside a function, you cannot do a service request, because a service request is an exchange of control. If you call a heaped procedures inside a function, it is run by a mini-scheduler. This mini-scheduler handles subroutine calling and return, but not channel communication. But it could! Instead of the mini-scheduler, we could call the full scheduler. Now, suppose we write to a channel. The reader is hanging on the channel and gets rescheduled *on the functions instance of the scheduler*. This should be cool, even if that procedure previously suspended off the top level scheduler -- not the wording "off" the top level scheduler. There's no reason i can think of why it matters where fibre is executed *provided* it doesn't execute concurrently with another fibre with which it shares memory (since fibres do not do any locking or whatever to access memory). This is actually quite cute, provided I can get my head around the termination (when the function nested fibres all terminate, the function can proceed). So actually .. fibre COULD span function boundaries!! This would be a major breakthrough. the only caveat is probably that only the top level can go over to async I/O when the fibre stack is empty .. though even that isn't clear. Hmmm .. mmm mmMM MMM! Yum :) [Yes, the compiler "knows" when a function is calling a heap procedure! The funny thing is if the procedure is inlined .. the function may end up trying to do channel I/O which it can't do.... Thinking cap on. Refactoring the mainline to ensure exactly the right subroutine is available is required ... -- john skaller skal...@users.sourceforge.net http://felix-lang.org ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language