Skip to content

Conversation

fongwh1
Copy link

@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