1. A computer system for executing a task, the computer system comprising: a main processor, a processing element that includes a programmable engine configured for performing tasks autonomously, and a memory, the computer system configured to perform a method comprising: receiving, at the processing element, the task and an identifier of a support thread from the main processor; performing, by the processing element, an instruction specified by the task; determining, by the processing element, that a function that is part of the task is to be executed on the main processor; sending, by the processing element, via the support thread, a request to the main processor for execution of the function; and receiving, at the processing element, an indication that the main processor has completed execution of the function specified by the request.