As was mentioned earlier, tasks differ from software interrupts in a very fundamental way. Swis are threads that always run to completion. Although they can be preempted by higher priority Swis and by hardware interrupts, they cannot block themselves while waiting for an event. Additionally, they must be implemented in a way that allows them to exit. Tasks on the other hand are often implemented as an infinite loop, only exiting when the application as a whole is shutting down, or if the system resources are being changed in a fundamental way. When they need to wait for some kind of event to occur or resource to become available, they will block themselves using some kind of semaphore, which will be discussed later in this presentation.