-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
208c657
commit 056ef5e
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @file lts.h | ||
* @author Tomás Sánchez <[email protected]> | ||
* @brief Long Time Scheduler Class | ||
* @version 0.1 | ||
* @date 05-10-2022 | ||
* | ||
* @copyright Copyright (c) 2022 | ||
* | ||
*/ | ||
|
||
// ============================================================================================================ | ||
// ***** Public Functions ***** | ||
// ============================================================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @file lts.c | ||
* @author Tomás Sánchez <[email protected]> | ||
* @brief | ||
* @version 0.1 | ||
* @date 05-10-2022 | ||
* | ||
* @copyright Copyright (c) 2022 | ||
* | ||
*/ | ||
|
||
#include <stdlib.h> | ||
#include "kernel.h" | ||
#include "pcb_unit.h" | ||
|
||
void * | ||
long_time_schedule(void *kernel_ref) | ||
{ | ||
kernel_t *kernel = kernel_ref; | ||
|
||
for (;;) | ||
{ | ||
// Wait for a process to be created. | ||
WAIT(kernel->sync.dispatch); | ||
// TODO: Fetch from pcbs | ||
} | ||
|
||
return NULL; | ||
} | ||
|
||
void admit_process(kernel_t *kernel, pcb_t *pcb) | ||
{ | ||
pcb_unit_t *process = new_pcb_unit(pcb); | ||
// TODO: add to READY QUEUE | ||
} |