Hi Biping, Jay, Sorry on the late reply, I was at the JavaOne conference last week helping out at the Drizzle booth. :)
On Wed, Jun 03, 2009 at 11:40:22AM -0400, Jay Pipes wrote: >> However, a stateful execution engine requires us to implement the >> state management by ourself: >> >> - How we react when a session is blocked at some socket I/Os. >> I'm thinking if the execution path is flattened, and all Socket I/O >> are separated out from the execution call, in a form of something like >> this: >> Socket I/O read/write + Execution method call 1 + Socket I/O >> read/write + Execution method call 2+ Socket I/O read/write + >> Execution method call 3+ ... >> then it'll be very easy for us to remember the state. A simple number >> can tell us all we need. > > This is actually very similar to how libdrizzle's protocol stack works. Yes, libdrizzle uses a callback stack, so we can easily track states just by pushing and popping function pointers off the stack. I'd suggest using the same method in drizzled, this avoids enumerating your states and having those nasty giant switch statements. >> I am proposing this, because I think there will be much more >> information we need to remember if execution calls are nested, like >> how deep we have went along the stack. Besides we always have to >> rebuild a calling stack when the session is resumed. >> But I guess it will be very hard to make the execution path flattened >> if some recursive execution procedures exist. > > Yes, this is a big problem. It just means keeping more state variables in the Session object along with the state stack. I wouldn't say it's a big problem, but it is going to be a significant amount of work. >> How do you think of this flattened execution style? Do you think it is >> realizable or/and worth to be realized? > > Yes. It's realizable, but not something that can be done this summer :) Yeah, just coming up with a plan and maybe working through the first few layers is a good start for GSoC. This project will need to go beyond that timeframe. -Eric _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

