A method for performing software-based switching functions by a processing circuit of a switching device , said switching device further comprising a host stack and at least two medium access controller, MAC, units for communicating data frames on a communication channel, said host stack including application software executed by the switching device , said at least two MAC units being connected to the processing circuit , said software-based switching functions comprising forwarding data frames received by one of the MAC units towards another one of the MAC units and/or towards the host stack, and/or forwarding data frames received from the host stack towards one of the MAC units, the communication over the communication channel being organized according to successive temporal cycles, each temporal cycle comprising at least a first time slice and a second time slice, said first time slices for communicating data frames having higher timing constraints than data frames communicated during said second time slices, the processing circuit implementing a real-time operating system, RTOS, which in normal operation comprises a RTOS scheduler for scheduling a plurality of tasks having different priorities, said method comprising: - (S31) applying, by the processing circuit , a first operating mode during each first time slice, in which normal operation of the RTOS is suspended in that the RTOS scheduler is suspended; the processing circuit executes a single task which performs the software-based switching functions ; and interrupts are disabled and an interrupt service routine, ISR, is not executed such that the single task performing the software-based switching functions cannot be interrupted or preempted by another task; - (S32) applying, by the processing circuit , a second operating mode in each second time slice, in which normal operation of the RTOS is resumed and the RTOS scheduler schedules the plurality of tasks according to their respective priorities during the whole duration of the secoi time slice, wherein the task performing the software-based switch has not the highest priority of RTOS scheduler, thus allowing high processing priority tasks that were prevented from running during the first time slices to be prioritized over the task performing the software-based switching functions. - (S31) applying, by the processing circuit , a first operating mode during each first time slice, in which normal operation of the RTOS is suspended in that the RTOS scheduler is suspended; the processing circuit executes a single task which performs the software-based switching functions ; and interrupts are disabled and an interrupt service routine, ISR, is not executed such that the single task performing the software-based switching functions cannot be interrupted or preempted by another task; normal operation of the RTOS is suspended in that the RTOS scheduler is suspended; the processing circuit executes a single task which performs the software-based switching functions ; and interrupts are disabled and an interrupt service routine, ISR, is not executed such that the single task performing the software-based switching functions cannot be interrupted or preempted by another task; - (S32) applying, by the processing circuit , a second operating mode in each second time slice, in which normal operation of the RTOS is resumed and the RTOS scheduler schedules the plurality of tasks according to their respective priorities during the whole duration of the secoi time slice, wherein the task performing the software-based switch has not the highest priority of RTOS scheduler, thus allowing high processing priority tasks that were prevented from running during the first time slices to be prioritized over the task performing the software-based switching functions. <EOS>