1. A method comprising: performing a real-time task execution using a first thread on a first core of a multi-core processor; acquiring, by a second thread, a thread affinity for the second thread to execute the real-time task on a second core of the multi-core processor; storing a switch object in a queue that is accessible to the first thread and the second thread; writing, by the second thread, a callee ready indicator to a variable in the switch object; receiving, by the first thread, the callee ready indicator from the queue; writing, by the first thread, a caller ready indicator to the variable in the switch object; determining, by the second thread, that the caller ready indicator is in the variable; and transferring performance of the real-time task from the first thread to the second thread after the second thread is executing on the second core to perform the real-time task based at least in part on the determining.