1. A method for avoiding locks used to control simultaneous access of a critical section by multiple processes by speculatively executing critical sections of code, comprising: (a) allowing different processes to speculatively execute a critical section of code within a program without first acquiring a lock associated with the critical section; for at least some executions where a process completes the critical section without encountering an interfering data access from another process, the method further comprises: committing changes made during the speculative execution, and resuming normal non-speculative execution of the program past the critical section; for at least some executions where an interfering data access from another process is encountered during execution of the critical section, the method further comprises at least one of the following steps of: (i) discarding changes made during the speculative execution, and attempting to re-execute the critical section at least one time wherein attempting to re-execute the critical section involves speculatively re-executing the critical section; and (ii) acquiring a lock associated with the critical section, non-speculatively executing the critical section, and releasing the lock associated with the critical section.