Reading happens every other time

Hello.
There are two programs. One creates and transfers the file into memory, the other reads it. The problem is that reading happens every other time. That is, the data, then no. Where is the mistake? Where to look?

++.jpg