Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FlightOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Luntzer
FlightOS
Commits
2b0c3846
Commit
2b0c3846
authored
Mar 29, 2017
by
Armin Luntzer
Browse files
Options
Downloads
Patches
Plain Diff
data proc net: add pn_queue_critical_trackers()
parent
ccf08fb4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/data_proc_net.h
+10
-0
10 additions, 0 deletions
include/data_proc_net.h
lib/data_proc_net.c
+38
-1
38 additions, 1 deletion
lib/data_proc_net.c
with
48 additions
and
1 deletion
include/data_proc_net.h
+
10
−
0
View file @
2b0c3846
...
...
@@ -31,6 +31,16 @@ struct proc_net;
int
pt_track_execute_next
(
struct
proc_tracker
*
pt
);
void
pn_input_task
(
struct
proc_net
*
pn
,
struct
proc_task
*
t
);
void
pn_queue_critical_trackers
(
struct
proc_net
*
pn
);
struct
proc_tracker
*
pn_get_next_pending_tracker
(
struct
proc_net
*
pn
);
struct
proc_task
*
pn_get_next_pending_task
(
struct
proc_tracker
*
pt
);
void
pn_node_to_queue_head
(
struct
proc_net
*
pn
,
struct
proc_tracker
*
pt
);
void
pn_node_to_queue_tail
(
struct
proc_net
*
pn
,
struct
proc_tracker
*
pt
);
int
pn_eval_task_status
(
struct
proc_net
*
pn
,
struct
proc_tracker
*
pt
,
struct
proc_task
*
t
,
int
ret
);
int
pn_process_next
(
struct
proc_net
*
pn
);
int
pn_process_inputs
(
struct
proc_net
*
pn
);
int
pn_process_outputs
(
struct
proc_net
*
pn
);
...
...
This diff is collapsed.
Click to expand it.
lib/data_proc_net.c
+
38
−
1
View file @
2b0c3846
...
...
@@ -170,6 +170,19 @@ static int pn_task_to_next_node(struct proc_net *pn, struct proc_task *t)
}
/**
* @brief move a tracker node to the top of the processing net queue
*
* @param pn a struct proc_net
* @param pt a struct proc_tracker
*/
void
pn_node_to_queue_head
(
struct
proc_net
*
pn
,
struct
proc_tracker
*
pt
)
{
list_move
(
&
pt
->
node
,
&
pn
->
nodes
);
}
/**
* @brief move a tracker node to the end of the processing net queue
*
...
...
@@ -183,6 +196,28 @@ void pn_node_to_queue_tail(struct proc_net *pn, struct proc_tracker *pt)
}
/**
* @brief move critical trackers to head of queue
*
* @param pn a struct proc_net
*
* @note this does not sort, but rather moves any critical trackers to the
* top op the queue
*/
void
pn_queue_critical_trackers
(
struct
proc_net
*
pn
)
{
struct
proc_tracker
*
pt
;
struct
proc_tracker
*
p_tmp
;
list_for_each_entry_safe
(
pt
,
p_tmp
,
&
pn
->
nodes
,
node
)
{
if
(
pt_track_level_critical
(
pt
))
pn_node_to_queue_head
(
pn
,
pt
);
}
}
/**
* @brief locate the first tracker that holds at least one task
*
...
...
@@ -327,6 +362,9 @@ int pn_process_next(struct proc_net *pn)
struct
proc_tracker
*
pt
;
/* make sure critical trackers are on top */
pn_queue_critical_trackers
(
pn
);
pt
=
pn_get_next_pending_tracker
(
pn
);
if
(
!
pt
)
return
cnt
;
...
...
@@ -346,7 +384,6 @@ int pn_process_next(struct proc_net *pn)
/* move processing task to end of queue */
/* XXX should insert that based on critical level/fill state */
pn_node_to_queue_tail
(
pn
,
pt
);
return
cnt
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment