7 | | The GIET_VM threads try to implement the POSIX threads. A thread is statically allocated to a physical processor, as defined in the mapping, and the GIET-VM does not support thread migration. There is one scheduler per processor, and the max number of threads on one single processor cannot be larger than 13. A thread can be in three different states: |
8 | | * '''RUNNING''' the thread is currently executed. |
9 | | * '''RUNNABLE''' the thread is not running, but can be selected for execution at the next TICK. |
10 | | * '''BLOCKED''' the thread is blocked, waiting on a condition defined in the NORUN context slot. |
| 7 | |
| 8 | == __thread context definition__ == |
| 44 | == __thread states__ == |
| 45 | |
| 46 | A thread is statically allocated to a physical processor, as defined in the mapping, and the GIET-VM does not support thread migration. There is one scheduler per processor, and the max number of threads on one single processor cannot be larger than 13. The giet VM supports both user threads, that can dymamically activated by the applications, using the POSIX threads API), and kernel threads that are statically created at kernel init, to support background tasks. |
| 47 | |
| 48 | Both User and Kernel threads can be in three different states: |
| 49 | * '''RUNNING''' the thread is currently executed. |
| 50 | * '''RUNNABLE''' the thread is not running, but can be selected for execution at the next TICK. |
| 51 | * '''BLOCKED''' the thread is blocked, waiting on a condition defined in the NORUN context slot. |
| 52 | |
| 53 | The various blocking causes are defined below: |
| 54 | || nmnemonic || cause || |
| 55 | || NORUN_MASK_THREAD || thread not activated || |
| 56 | || NORUN_MASK_IOC || blocked on IOC transfer || |
| 57 | || NORUN_MASK_COPROC || blocked on COPROC transfer || |
| 58 | || NORUN_MASK_TTY || blocked on TTY_RX transfer || |
| 59 | || NORUN_MASK_NIC_RX_FULL || blocked on NIC RX FIFO full || |
| 60 | || NORUN_MASK_NIC_RX_EMPTY || blocked on NIC TX QUEUE empty || |
| 61 | || NORUN_MASK_NIC_TX_FULL || blocked on NIC RX QUEUE full || |
| 62 | || NORUN_MASK_NIC_TX_EMPTY || blocked on NIC TX FIFO empty || |
| 63 | |
| 64 | |
| 65 | == __acccess functions__ == |