-
1. Re: Can costly operations be performed in IdleHook()?
shachar carmi Aug 3, 2010 8:32 AM (in response to dheeraj_c)a good question with no straight answer.
let's begin with the end.
effects have the PF_ABORT macro to use. AEGPs don't.
the only way i can think of, for detecting user interruptions via an AEGP is to call an effect using effectCallGeneric() and have the effect call PF_ABORT for you.
i never tried that and i don't know if effects really can detect interruptions during a COMPLETELY_GENERAL call.
perhaps there's another way, but i don't know of it.
having said that, we now return to the beginning.
is it ok to perform costly operations during idle process?
if you successfully detect user interruptions then the user won't feel AE being "stuck".
on the other hand, if other plug-ins are relying on idle process, they will be randomly denied idle time.
why randomly?
you don't know the order in which AE calls all those who requested idle time.
i'm guessing AEGPs get called first, (but that's a guess).
do you have to do heavy calculations on every idle hook call?
could you do that every 100 or 1000 calls instead?
that would really ease the load on the system.
you could also display a window telling the user you're doing some calculations.
how heavy is that process anyways???
bottom line?
hogging idle process time is not worng (if you detect user interruptions), it's just rude (if other plug-ins are relying on it too).
-
2. Re: Can costly operations be performed in IdleHook()?
dheeraj_c Aug 3, 2010 11:04 PM (in response to shachar carmi)Thanks again Shachar.
I do not do the costly operations every time in idle hook and it's not too heavy. I go through all the effects once in the idle hook only when any operation on my effect is performed.
The reason why I asked this question on forum is that AE crashes randomly (only on MAC and not on Windows) when I communicate from AEGP to effect using AEGP_EffectGeneric() in IdleHook().
So I can try what you suggested. I will use PF_PROGRESS() to detect any interrupts.
Thanks for sharing your ideas Shachar.
Any more suggestions?


