1. A computer-implemented method, comprising: attempting to execute a section of code as a transaction using a hardware transactional memory system; the hardware transactional memory system detecting that the transaction aborted or will abort; and in response to said detecting: the hardware transactional memory system sending an indication of said detecting to a software mechanism; in response to receiving the indication, the software mechanism determining a mode of execution, wherein the mode of execution comprises speculative transaction mode or non-speculative mode; the software mechanism communicating the determined mode of execution to the hardware transactional memory system; and the hardware transactional memory system attempting to execute the section of code using the determined mode of execution.