Skip to content

[fixes#2] Adding a simple TCB and a new variable 'next_task'#4

Open
fongwh1 wants to merge 3 commits intoembedded2015:masterfrom
fongwh1:fixes2
Open

[fixes#2] Adding a simple TCB and a new variable 'next_task'#4
fongwh1 wants to merge 3 commits intoembedded2015:masterfrom
fongwh1:fixes2

Conversation

@fongwh1
Copy link
Copy Markdown

@fongwh1 fongwh1 commented Apr 24, 2015

Two changes:

  1. A simple task_control_block consists of a stack and a task pointer;
  2. A new variable 'next_task' indicates the following task to run.

fongwh1 added 3 commits April 25, 2015 11:26
An additional variable 'next_task' is helpful and clear for those who
wants to change something according to the next task.

If only 'current_task' is used, it must implicitly assume that the next
task is the current task before kernel selects the next one.

It is a fault when more than 2 tasks are created, for example:

 if Task [length of execution] => 1[1T], 2[2T], 3[3T]
 Task :       1 -> 2 -> 3 -> 1 -> 2 ->3
 Length of execution : 1T->2T->1T->2T->3T->1T (<--- which is wrong)
Use

typedef struct {
    ...
} tcb;

instead of

struct task_c_b {
    ...
} typedef tcb;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant