Hi Tibor,
Thanks very much for your reply.
"Once a single use application started there should be no more threads added to it so there is no need to fire the ThreadFinished event after all initial threads finished and the application finished."
So multi-use applications equate to those applications where threads are added dynamically or "on-the-fly". This makes sense. I have recently changed the Tutorial_OTF and this is when I observed the peculiar behaviour that I described. However, what has confused me is that this example creates an application that is not multi-use. So I was left somewhat mystified about what multi-use meant.
"So it looks like we should restrict the StartThread call only for multi use applications. Unless there are objections to this change I would add this to the bug list in SourceForge so we can keep track of the change."
I agree. I observed this fault because I was incorrectly using multi-use applications. Your suggestion will fix two problems; it will help developers using StartThread and it will avoid the behaviour that was observed.
"I may have misunderstood the problem you described. If so then please send over some more details or client side code that reproduces the problem."
I should apologise for not describing how to reproduce this behaviour. After adding the last thread timeout to GApplication, I used Tutorial_OTF example to test it. I changed Tutorial_OTF to include a one minute last thread timeout. Then I added an application finish event handler and observed this strange behaviour.
Running the latest version of Tutorial_OTF will behave as before except that it will display "application finished" after about one minute of the user not adding extra threads. If the user then adds extra threads then the results from those threads will be displayed.
Comment out the following line from MultiplierApplication.Main:
ga.ApplicationFinish += new GApplicationFinish(ApplicationFinished);
Running this modified version of Tutorial_OTF will behave as before except that it will display "application finished" after about one minute of the user not adding extra threads. However, with this modified version, if the user then adds extra threads then the results from those threads will not be displayed.
I thought that it was strange that the behaviour of ThreadFinish events should depend upon the existence of an ApplicationFinish event handler.
In summary, I didn't understand multi-use applications, incorrectly used the alchemi framework, and observed some strange behaviour. You suggest adding an exception to make sure that developers can only use StartThread on multi-use applications.
Thanks again,
Michael.
------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642 _______________________________________________ Alchemi-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/alchemi-developers
