A trusted execution environment scheduling method for a device comprising a multicore processor, the processor operable to execute a rich execution environment, REE, (131, 132, 133, 134) and a trusted execution environment, TEE, (141, 142, 143, 144) the method comprising: providing a REE global scheduler (151, 152, 153, 154) in the REE, the REE global scheduler operable to schedule threads for execution in the REE; providing a TEE scheduler (161, 162, 163, 164) in the TEE, the TEE scheduler operable to schedule threads for execution in the TEE, wherein the TEE scheduler determines a number of runnable TEE threads (171, 172, 173, 174) which are either presently executing or are awaiting execution in the TEE, and stores the number of runnable TEE threads in a location accessible to threads executing in the REE; providing a plurality of worker threads (181, 182, 183, 184) in the REE, the worker threads being in an activated state or in an deactivated state, wherein when an activated worker thread of the plurality of worker threads is executed according to the schedule of the REE global scheduler the worker thread makes a call to the TEE to cause execution of the TEE on the same core as the worker thread, wherein the worker thread retrieves the number of runnable TEE threads and compares the retrieved number of runnable TEE threads to the number of currently activated worker threads, wherein in response to a determination that the number of runnable TEE threads is greater than the number of currently activated worker threads, the worker thread activates additional worker threads, and wherein in response to a determination that the number of runnable TEE threads is fewer than the number of currently activated worker threads, the worker thread deactivates itself. providing a REE global scheduler (151, 152, 153, 154) in the REE, the REE global scheduler operable to schedule threads for execution in the REE; providing a TEE scheduler (161, 162, 163, 164) in the TEE, the TEE scheduler operable to schedule threads for execution in the TEE, wherein the TEE scheduler determines a number of runnable TEE threads (171, 172, 173, 174) which are either presently executing or are awaiting execution in the TEE, and stores the number of runnable TEE threads in a location accessible to threads executing in the REE; providing a plurality of worker threads (181, 182, 183, 184) in the REE, the worker threads being in an activated state or in an deactivated state, wherein when an activated worker thread of the plurality of worker threads is executed according to the schedule of the REE global scheduler the worker thread makes a call to the TEE to cause execution of the TEE on the same core as the worker thread, wherein the worker thread retrieves the number of runnable TEE threads and compares the retrieved number of runnable TEE threads to the number of currently activated worker threads, wherein in response to a determination that the number of runnable TEE threads is greater than the number of currently activated worker threads, the worker thread activates additional worker threads, and wherein in response to a determination that the number of runnable TEE threads is fewer than the number of currently activated worker threads, the worker thread deactivates itself. wherein when an activated worker thread of the plurality of worker threads is executed according to the schedule of the REE global scheduler the worker thread makes a call to the TEE to cause execution of the TEE on the same core as the worker thread, wherein the worker thread retrieves the number of runnable TEE threads and compares the retrieved number of runnable TEE threads to the number of currently activated worker threads, wherein in response to a determination that the number of runnable TEE threads is greater than the number of currently activated worker threads, the worker thread activates additional worker threads, and wherein in response to a determination that the number of runnable TEE threads is fewer than the number of currently activated worker threads, the worker thread deactivates itself.