1. A computer storage medium having computer-executable instructions for causing a computer to perform steps comprising: provide a transactional memory system; transform a first section of code containing an original sequential loop into a second section of code containing a parallel loop that uses a plurality of transactions to preserve an original input to output mapping; and execute the second section of code using the transactional memory system, with at least some of the plurality of transactions being executed on different threads, wherein if the original sequential loop is determined to be immune to reordering, then the second section of code is created in a manner that allows each of the transactions to commit in an order that does not depend on an execution order of the original sequential loop.