> (~12 hours)
1 frame lost per minute gives you 720 frames over 12 hours.
That sounds like a lot of memory.
You previously said
"I've a webcam running 25fps. I process each image, processing takes almost 1 second."
That's 24 lost per second!
What's changed?
I would suggest that if you can't keep up, then the backlog will kill you because you'll never be in a position to catch up.
Code:
while ( 1 ) {
readImage(buffer);
processImage(buffer);
}
No threads, no disks.
If that can't keep up, then threads and disks will not make it any better for you.