La Orden del Frijol Pinto
1.0.0
1.0.0
  • La Orden Del Frijol Pinto
  • Threads
    • Structs
    • Alarm Clock
    • Priority Scheduler ⌚
    • Advanced Scheduler
  • USERPROG
    • Structs
    • Argument Passing
    • System Calls
    • Extras
  • VM
    • Frame Table
    • Suplementary Page Table
    • Swap Table
    • Lazy Loading
    • Stack Growth
  • Resultados
Powered by GitBook
On this page
  • ¿ En qué consiste?
  • ALGORITMOS:

Was this helpful?

  1. Threads

Alarm Clock

La primera asignación del proyecto de Threads.

¿ En qué consiste?

Esta asignación consiste en que los threads puedan dormir una cantidad de ticks sin utilizar busy waiting. Para lograr esto hay que utilizar la cola de threads con estado BLOCK y colocar en esa cola el thread, y cuando pase tiempo que el indico para estar dormido cambiar su estado de BLOCK a READY.

ALGORITMOS:

SLEEP_THREAD:
    INDICAR EL TIEMPO POR DORMIR
    AGREGAR EL THREAD A LISTA DE THREADS DURMIENDO
    CAMBIAR DE READY A BLOCK
WAKE_THREAD(ticks):
    thread aux = LISTA_THREAD_DURMIENDO[0]
    MIENTRAS aux = LISTA_THREAD_DURMIENDO.LAST:
        SI aux.sleep_time == ticks ENTONCES 
            REMOVER aux DE LA LISTA
            DESBLOQUEAR EL THREAD

wake_thread(ticks) es llamado en cada interrupción del timer. Esto asegura que el thread durmió al menos el tiempo que el pidió.

PreviousStructsNextPriority Scheduler ⌚

Last updated 4 years ago

Was this helpful?