Sobes.tech
Junior — Middle

Kui palju tüüpi järjekordi on GMP mudelis rakendatud?

sobes.tech AI

Vastus AI-lt

In the GMP model (Golang GMP — an internal model of the goroutine scheduler, M — OS thread, P — processor), two main types of queues are implemented:

  1. Local run queue — a local queue of tasks (goroutines) for each P (processor). Each P has its own queue from which it takes tasks to execute.

  2. Global run queue — a global queue of tasks shared by all P's, where tasks are placed if local queues are full or during load balancing.

Thus, in the GMP model, two main queues are implemented for goroutine scheduling: local and global.