Commercially available hardware transactional memory (HTM) implementations resolve a number of potentially problematic situations by aborting a transaction, rather than add the hardware complexity needed to handle each situation more gracefully. In this paper we propose pre-abort handlers, a general-purpose mechanism that invokes a software handler instead of aborting the transaction. The handler is executed non-transactionally while a transaction's execution is paused, allowing the handler to decide on and then perform the actions appropriate for the specific situation that caused the handler to be invoked. We use our pre-abort handler mechanism to salvage a transaction's already-performed work in several common scenarios, and also to allow controlled nesting of non-transactional work within a transaction, without further changes to the hardware (beyond pre-abort handler support itself). In contrast, prior work on abort mitigation and on allowing non-transactional work within transactions requires dedicated hardware support for mitigation of each type of problematic situation. CCS CONCEPTS • Computer systems organization → Multicore architectures;