1. A method, comprising: a processor device executing program code in one or more threads, the processor device detecting a call of a function in one of the one or more threads; the processor device executing the function in a further thread; the processor device determining a plurality of functions which are currently being executed by the processor device; the processor device creating a sorted list of depths of the plurality of functions; the processor device selecting a depth from the sorted list of depths depending on its position in the sorted list of depths, wherein, as a number of performed rollbacks to a last saved state of the processor device increases, the position moves towards an end of the sorted list of depths which corresponds to higher depths; and the processor device performing a selection between saving a state of the processor device when starting execution of the function in the further thread and not saving the state of the processor device when starting execution of the function in the further thread, wherein the selection depends on a comparison of a depth of the function to the depth selected from the sorted list of depths.