Your OS process scheduler should do it to some degree at runtime, but beyond that there is not a lot that can be achieved without explicitly handling synchronization and locking of shared resources. I know there are some startups working on parallel processing optimizations though, so there could be some new developments in the future. Google has been acquiring a few of these startups recently..