-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #433 from lf-lang/gedf
Redesign of GEDF scheduler
- Loading branch information
Showing
19 changed files
with
352 additions
and
553 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 |
---|---|---|
@@ -1,32 +1,11 @@ | ||
/** | ||
* @file | ||
* @author Erling R. Jellum ([email protected]) | ||
* @author Erling R. Jellum | ||
* @copyright (c) 2023-2024, The Norwegian University of Science and Technology. | ||
* License: <a href="https://github.com/lf-lang/reactor-c/blob/main/LICENSE.md">BSD 2-clause</a> | ||
* | ||
* @section LICENSE | ||
* Copyright (c) 2023, The Norwegian University of Science and Technology. | ||
* | ||
* Redistribution and use in source and binary forms, with or without modification, | ||
* are permitted provided that the following conditions are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY | ||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | ||
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | ||
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* @section DESCRIPTION Functions intitializing and freeing memory for environments. | ||
* See environment.h for docs. | ||
* This file defines functions intitializing and freeing memory for environments. | ||
* See environment.h for docs. | ||
*/ | ||
|
||
#include "environment.h" | ||
|
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
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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/** | ||
* @file | ||
* @author Edward A. Lee ([email protected]) | ||
* @author{Marten Lohstroh <[email protected]>} | ||
* @author{Soroush Bateni <[email protected]>} | ||
* @author Edward A. Lee | ||
* @author Marten Lohstroh | ||
* @author Soroush Bateni | ||
* @copyright (c) 2020-2024, The University of California at Berkeley. | ||
* License: <a href="https://github.com/lf-lang/reactor-c/blob/main/LICENSE.md">BSD 2-clause</a> | ||
* @brief Runtime infrastructure for the threaded version of the C target of Lingua Franca. | ||
|
@@ -850,19 +850,13 @@ void _lf_worker_invoke_reaction(environment_t* env, int worker_number, reaction_ | |
reaction->is_STP_violated = false; | ||
} | ||
|
||
void try_advance_level(environment_t* env, volatile size_t* next_reaction_level) { | ||
#ifdef FEDERATED | ||
lf_stall_advance_level_federation(env, *next_reaction_level); | ||
#else | ||
(void)env; | ||
#endif | ||
if (*next_reaction_level < SIZE_MAX) | ||
*next_reaction_level += 1; | ||
} | ||
|
||
/** | ||
* The main looping logic of each LF worker thread. | ||
* This function assumes the caller holds the mutex lock. | ||
* @brief The main looping logic of each LF worker thread. | ||
* | ||
* This function returns when the scheduler's lf_sched_get_ready_reaction() | ||
* implementation returns NULL, indicating that there are no more reactions to execute. | ||
* | ||
* This function assumes the caller does not hold the mutex lock on the environment. | ||
* | ||
* @param env Environment within which we are executing. | ||
* @param worker_number The number assigned to this worker thread | ||
|
@@ -882,10 +876,9 @@ void _lf_worker_do_work(environment_t* env, int worker_number) { | |
while ((current_reaction_to_execute = lf_sched_get_ready_reaction(env->scheduler, worker_number)) != NULL) { | ||
// Got a reaction that is ready to run. | ||
LF_PRINT_DEBUG("Worker %d: Got from scheduler reaction %s: " | ||
"level: %lld, is input reaction: %d, chain ID: %llu, and deadline " PRINTF_TIME ".", | ||
"level: %lld, is input reaction: %d, and deadline " PRINTF_TIME ".", | ||
worker_number, current_reaction_to_execute->name, LF_LEVEL(current_reaction_to_execute->index), | ||
current_reaction_to_execute->is_an_input_reaction, current_reaction_to_execute->chain_id, | ||
current_reaction_to_execute->deadline); | ||
current_reaction_to_execute->is_an_input_reaction, current_reaction_to_execute->deadline); | ||
|
||
bool violation = _lf_worker_handle_violations(env, worker_number, current_reaction_to_execute); | ||
|
||
|
Oops, something went wrong.