As of the below commits, Felix is officially broken. Most of the tests pass, but asynchronous socket I/O fails. So the webserver, for example, doesn't work. I think timers and threads work but I'm not 100% sure.
The commit is an upgrade to the embeddable driver handling. Code is move about, refactored, and rewritten to be more comprensible. It's still Italian, but now it's more like Ravioli than Spaghetti. Significantly to the purpose of the driver change is the ability to run Felix as a program OR embed it in a foreign event loop. The previous driver code until these breaking commits couldn't do that properly. Now, the main driver code works like a simple embedding environment. This is done by providing two functions to run Felix. world->run_until_complete() runs Felix until there is nothing left. That includes satisfaction of outstanding asynchronous requests such as timers and sockets. The new program driver uses that. The second function: world->run_until_blocked() runs until the synchronous scheduler runs out of active fibres AND there are no fibres on the "serviced" asynchronous queue. There can still be pending requests. So if the synchronous fibres are slow enough, by the time they're done, a timer event might fire or a socket deliver some data, and Felix will continue. It doesn't return until it would block waiting. That call returns an integer: Negative: an error code, terminate Felix Otherwise: the number of pending requests If the number is zero, Felix is done, but by one means or another it can be restarted with more work to do. Once I get the driver to actually work, I'll focus on providing ways to feed Felix new jobs in a foreign event loop. An obvious one is to create a new continuation from some procedure, bind it to an fthread, and stick the fthread on the async ready ("serviced") queue. Felix will then schedule it as per usual. I have already factored all the SVC service calls into subroutines to aid emulating Felix operation in C++ code. ================================================================ commit cf858efc63ae96b8996313ab3c05c28826ec353b Author: skaller <max.skal...@gmail.com> Date: Sat Mar 1 07:00:07 2014 +1100 Fix python build to use world stuff. commit f30c0d22fb4f1b9e2c6451dcc407123739eb7fc4 Author: skaller <max.skal...@gmail.com> Date: Sat Mar 1 01:22:56 2014 +1100 Refactor scheduler code. flx_world now has two schedulers: run_until_blocked() run_until_complete() The first one runs until it would block or terminate, then returns a count of the number of pending requests on the asycn queue, or -ve number for error. The second one runs, blocking on the async queue, until there are no pending requests or an error and returns 0 or a -ve number for error. Use the first one in embedded foreign event loops. The second one is used by the standard driver. -- 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