Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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