Scheduling Policy

What is the scheduling policy of Apache for PHP files?

On a server with single core processor, is it possible for one user’s PHP process to be pre-empted by another user’s PHP process? My PHP script depends on the fact that the whole file gets processed before getting interrupted. It needs to insert entries into a MySQL database with consecutive ID numbers. I’m worrying that if my site gets high traffic and Apache has some complicated scheduling policy, these ID numbers could become non-consecutive.

On servers with multi-core processors, is this even more dangerous?