> > There are a couple situations where we need to know if an Executor is > alive. > 1) Before we send a new thread to it > 2) While an Executor has been sent a thread, and is processing it, but > before it has finished > > As for 1, the approach of determining if an Executor is alive via > failed or successful communication per your suggestion makes sense. > This would also allow Executors to leave and return to the grid > transparently to the Manager. > > However, for 2, it's important for the Manager to know if an Executor > is actually alive and just busy processing a task, or whether it has > dropped off the grid. The Manager can then react appropriately and > resend the thread as necessary. > > To do this, we could have a heartbeat mechanism that is activated upon > receipt of a thread, and deactivated upon completion of it. If the > heartbeat stops, we lost the Executor. Otherwise, it's just busy. > > Any other solutions? >
This reminds of me the other problem with the heartbeat thread: you really do not get any information from the actual running thread which could be hanging. The heartbeat is only useful to determine if the computer is reachable. You could also take the following approach: 1. Set a time-out value for the thread. This could be Application, Executor or Manager configurable. 2. Require longer running threads to signal back progress information. This could be done through events. 3. If the thread is not telling us what is going on in the allotted time then it gets the axe. 4. We might want to build in some event (ThreadTimeoutEvent for example) that the thread could subscribe to through which the Manager could request the progress information. This would give the application the option to either subscribe to this event or to tell us how things are going at certain milestones. I imagine that complex threads might want to do both. We could put in the client side framework the basic plumbing for this setup so there would be minimal extra coding required in the application. Tibor ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Alchemi-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/alchemi-developers
