Timing and speed issues with pin change interrupt based routines - Arduino slow?

cantore:
You say that you only change flag from the ISR and after you perform the task in the main program. This is a good thechnique but are you sure the following ISR will not change the flag before the main code of the previous has been executed?

Good question. So in the code I need to execute functions only when a flag is set, if an ISR is called while in the middle of this function it will just set the same flag to ON as before and then the code will return to executing what it was doing before being interrupted. At the end of processing the function that was conditional on a specific flag it then sets that flag to OFF again.

Is there a better way to do this?