On 3 Aug 2007, at 07:49, Riccardo wrote:
Hi,
On 2007-08-03 08:18:10 +0200 Richard Frith-Macdonald
<richard@tiptree.demon.co.uk> wrote:
2. check that the apps are still responding if it's more than 30
seconds since the last time launchedApplications was called.
I'm not sure that (2) is a good idea though ... the check has
the potential to be very slow and can potentially remove an app
from the list when it's only temporarily not responding, rather
than permanently hung. Thoughts?
What means responding?
Slow (over 5 seconds) to respond...
Some apps might be "busy" for quite some time. FTP release (0.1,
not current CVS) is not threaded, thus when it downloads a file
usually gnustep doesn't update the window at all (and also can
cause focus problems... this is very nasty). Would a download of
over 30seconds make it mark as crashed?
Only if you called the launchedApplications method during that 30
second delay.
Current FTP uses NSTask so it shouldn't happen, if at all. But it
is just an example...
Yes ... that's why I worry about doing the check ... in general
apps should be written to avoid such delays (easily done using
asynchronous I/O, or threads, or subtasks for slow operations) but
some may not, and there are always cases where an operation can
take an unanticipatedly long time.
Of course, when an app becomes active again after being inactive,
it will put itsself back in the list of launched apps, so it's not
that big a deal if we remove it while it's not responding, but I
wonder if we actually *want* the list to contain hung/slow apps.
Perhaps we do.