Automatic parallelization of purely functional code is simply the problem of predicting what to speculatively start evaluating while the main sequential evaluation is going on. This prediction can be done by programmer-specified directives, theorem-proving, machine learning, and profile/trace analysis of a previous run. The prediction may be done at compile time or just-in-time with a runtime interpreter.
Even stateful code may be treated similarly if we have good knowledge of who reads and writes which components of state (the good ol' scheduling problem).
No comments :
Post a Comment