CONFIG_NUM_COOP_PRIORITIES

Number of coop priorities

Type: int

Help

Number of cooperative priorities configured in the system. Gives access
to priorities:

      K_PRIO_COOP(0) to K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)

or seen another way, priorities:

      -CONFIG_NUM_COOP_PRIORITIES to -1

This can be set to zero to disable cooperative scheduling. Cooperative
threads always preempt preemptible threads.

The total number of priorities is

 NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1

The extra one is for the idle thread, which must run at the lowest
priority, and be the only thread at that priority.

Defaults

Kconfig definition

At <Zephyr>/kernel/Kconfig:26

Included via <Zephyr>/Kconfig:8<Zephyr>/Kconfig.zephyr:40

Menu path: (Top) → General Kernel Options → Multi-threading

config NUM_COOP_PRIORITIES
    int "Number of coop priorities" if MULTITHREADING
    range 0 128
    default 1 if !MULTITHREADING
    default 16
    help
      Number of cooperative priorities configured in the system. Gives access
      to priorities:

            K_PRIO_COOP(0) to K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)

      or seen another way, priorities:

            -CONFIG_NUM_COOP_PRIORITIES to -1

      This can be set to zero to disable cooperative scheduling. Cooperative
      threads always preempt preemptible threads.

      The total number of priorities is

       NUM_COOP_PRIORITIES + NUM_PREEMPT_PRIORITIES + 1

      The extra one is for the idle thread, which must run at the lowest
      priority, and be the only thread at that priority.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)