Search found 9 matches

by Khan
Thu Mar 16, 2017 11:53 pm
Forum: ChibiOS/RT
Topic: thread data structure
Replies: 4
Views: 3451

Re: thread data structure

Hi

What is difference between preempt and time in thread data structure ?

Khan.
by Khan
Wed Mar 15, 2017 12:52 am
Forum: ChibiOS/RT
Topic: thread data structure
Replies: 4
Views: 3451

Re: thread data structure

Hi,

When i copied lines in structures (thread, ready list), it solved my problem. Can you explain it to me ? I thought that in c it does no matter how is structure written. Is it because I cast it in pointer of thread like: cp = (thread_t *)&ch.rlist.queue;

Thank you

Khan
by Khan
Tue Mar 14, 2017 7:43 pm
Forum: ChibiOS/RT
Topic: thread data structure
Replies: 4
Views: 3451

thread data structure

Hi
I'm trying to implement data structure in scheduler, but when I initialize it in:
chschd.c
void _scheduler_init(void) {
ch.rlist.dl = (systime_t)50;
}
I get big number in:
thread_t *chSchReadyI(thread_t *tp) {
cp = (thread_t *)&ch.rlist.queue;
cp->dl //-> this is not 50
}

chschd.h
struct ...
by Khan
Sun Mar 12, 2017 5:25 pm
Forum: ChibiOS/RT
Topic: RR Scheduler
Replies: 11
Views: 6315

Re: RR Scheduler

Hi

Can you help me with that, or can you put me on right direction how to do that?
by Khan
Sun Mar 12, 2017 5:09 pm
Forum: ChibiOS/RT
Topic: RR Scheduler
Replies: 11
Views: 6315

Re: RR Scheduler

Hi,
I thought that if i change priority with deadline, it will be possible to implement EDF ?
I will sort task (in ascending order) by deadline and run them just like in actual RR.
I'm trying to add deadline in data structure.

chschd.h
struct ch_thread{
systime_t dl;
}

struct ch_ready_list ...
by Khan
Thu Mar 02, 2017 9:41 pm
Forum: ChibiOS/RT
Topic: RR Scheduler
Replies: 11
Views: 6315

Re: RR Scheduler

Thank you very much for your answers. Is there any easy way to change scheduler algorithm ? I have school project to change scheduler algorithm and compare them.
by Khan
Thu Mar 02, 2017 3:16 pm
Forum: ChibiOS/RT
Topic: RR Scheduler
Replies: 11
Views: 6315

Re: RR Scheduler

If i change binary tree to binary heap i will have O(1) for get max and min. Will be this easier to implement ?
by Khan
Thu Mar 02, 2017 2:06 pm
Forum: ChibiOS/RT
Topic: RR Scheduler
Replies: 11
Views: 6315

Re: RR Scheduler

I know that ordered list is better solution for that problem, but I'm trying to implement RR with tree (school project)and compare both methods. Now i stuck:
thread_t *chSchReadyI(thread_t *tp) {
thread_t *cp;
thread_t *cp2;

cp2 = (thread_t *)&ch.rlist.tree; //idk why cp2 do not contain threads ...
by Khan
Thu Mar 02, 2017 1:20 pm
Forum: ChibiOS/RT
Topic: RR Scheduler
Replies: 11
Views: 6315

RR Scheduler

Hi
I added another data structure to scheduler(to keep threads in binary tree). But idk how put new thread in tree.
I added lines in code.
chsystypes.h
typedef struct ch_threads_tree threads_tree_t;

chschd.h
struct ch_threads_tree {
thread_t *left;
thread_t *right;
};
struct ch_thread ...