never mind .. not worth the flame war .. sorry
I have nothing but respect for you and all you do for CHDK, so I only have apologies if I'm making things hard for you and others. I have a lot to learn, including how things are done here. Please feel free to criticize or make suggestions, and I'll do my best to follow you're instructions.
So I promise I'll only start one more thread... when I release the shot_histogram modification source. I'm hoping you'll be the main one to try it out, and help make improvements.
I think this timing problem is at the root of all the strange bugs I've been uncovering lately, including the one in print_screen that I thought was related to your modifications. I'm hoping that someone who understands the inner workings of CHDK and shed some light on what's happening between different tasks. Is there a list of all the tasks that are running, and what they do?
What's the best way to communicate between tasks. I tried to set a variable in build_histogram and read it in get_histo functions called by Lua. It was unreliable. I just changed the flag variable to "volatile" and that seems to work, but I'm not sure. Does anyone know more about this?
And don't worry. Once I get this shot_histo thing working, I'm planning to spend a lot of time out in the snow taking pictures, so you'll have a break!