open File1 open File2 while (condition) { if (read from File1) { do something } if (read from File2) { do something; } }