Databases are slow at doing bulk updates. It's generally significantly faster to break bulk processing down into manageable chunks. It also avoids other database users experiencing significant blocking issues.
Linq include the Chunk method to make this process nice and easy.
var productIds = context.ProductIds;
foreach(var chunk in productIds.Chunk(10))
{
// Do stuff
}