No ACL setup yet! Denying access to everyone.
en:edu:zmitac:s2:aih:lab:nrf52threads

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:edu:zmitac:s2:aih:lab:nrf52threads [2023/11/23 17:25] – [Cooperative thread switching] ktokarzen:edu:zmitac:s2:aih:lab:nrf52threads [2023/12/01 13:52] (current) – ktokarz
Line 5: Line 5:
   * cooperative   * cooperative
   * preemptive   * preemptive
-In the cooperative method, the thread is executed until it gives the control back to OS. Thus thread can starve others while not releasing resources. This method is often used in embedded systems due to its low complexity and system overhead. Cooperative threads in Zephyr have a negative priority value (thus they have a relatively higher priority).+Zephyr OS implements both methods of thread switching. In the cooperative method, the thread is executed until it gives back the control to OS. Thus thread can starve others while not releasing resources. This method is often used in embedded systems due to its low complexity and system overhead. Cooperative threads in Zephyr have a negative priority value (thus they have a relatively higher priority).
 In the preemptive method, the thread is automatically suspended by the operating system when it decides to do so. Usually, the thread is given some period and is interrupted at the end of this period if there exists another thread to be executed. This method is implemented in general-purpose operating systems like Windows or Linux. It is much safer but more complicated and resource-consuming. In Zephyr preemptive threads have a positive priority number (thus they have a relatively lower priority). In the preemptive method, the thread is automatically suspended by the operating system when it decides to do so. Usually, the thread is given some period and is interrupted at the end of this period if there exists another thread to be executed. This method is implemented in general-purpose operating systems like Windows or Linux. It is much safer but more complicated and resource-consuming. In Zephyr preemptive threads have a positive priority number (thus they have a relatively lower priority).
-Zephyr OS implements both methods of thread switching.+
 ===== Thread switching example ===== ===== Thread switching example =====
 A cooperative thread gives control to the operating system in a few situations: A cooperative thread gives control to the operating system in a few situations:
Line 70: Line 70:
  
 </code> </code>
 +
 +===== The tasks for the laboratory =====
  
 To go through the lab please follow the steps: To go through the lab please follow the steps:
en/edu/zmitac/s2/aih/lab/nrf52threads.1700756733.txt.gz · Last modified: by ktokarz