I have created a shared object and access it from two different program and measuring the time.
DATA array is the shared object between two processes.<
I my opinion we can't predict the cache behavior as per your case.
It also depends upon your H/W which, you have not mentioned (like how many CPU cores(physical or logical) are present).
We can't say that program_2 will be scheduled on the same core and just after program_1 because it totally depends upon OS scheduler. So program_2 may use cache filled by program_1 or not.
It's possible that the cache is flushed out due to some other program which was scheduled just after program_1.