1. A method of processing a task on a processor adapted to process a plurality of tasks, the method comprising the steps of: processing the task by a producer thread and a consumer thread running concurrently, each thread executing at least a portion of the task, the threads communicating via a message queue comprising a plurality of messages produced by the producer thread to be processed by the consumer thread; detecting a transition of an occupancy state of the message queue from a substantially full state to a substantially empty state, wherein the state of the message queue is determined—based on the plurality of messages in the message queue to be processed by the consumer thread, and the transition of an occupancy state of the message queue from a substantially full state to a substantially empty state is caused by a further task interfering with processing of the task; and in the event of detecting the transition, processing the task sequentially by a single thread.