server/src/sched.h File Reference

prototypes for scheduling management More...

Go to the source code of this file.

Data Structures

struct  sched_t

Functions

int sched_init (void)
 initalize arrays
int sched_index (int prio)
int sched_response_time (sched_t *sched, int pos, sched_t *new_)
 Get the response time of the thread s.
int sched_prepare_free (int pos)
 Ask the watcher of a sched-entry to stop and wait for its readiness.
int sched_free (int pos)
 Free an element at the given position.
static int is_dp (sched_t *sched)
void lock_scheds (void)
void unlock_scheds (void)

Variables

l4_threadid_t main_id
int sched_cur_threads
int sched_max_threads
sched_t ** scheds
l4semaphore_t scheds_lock


Detailed Description

prototypes for scheduling management

Date:
09/04/2004
Author:
Jork Loeser <jork.loeser@inf.tu-dresden.de>

Definition in file server/src/sched.h.


Function Documentation

static int is_dp ( sched_t sched  )  [inline, static]

void lock_scheds ( void   ) 

int sched_free ( int  pos  ) 

Free an element at the given position.

Definition at line 139 of file sched.c.

References sched_t::dl_hist, sched_t::name, sched_cur_threads, sched_t::watch, and sched_t::watcher.

Referenced by l4cpu_reserve_delete_task_component(), and l4cpu_reserve_delete_thread_component().

int sched_index ( int  prio  ) 

int sched_init ( void   ) 

initalize arrays

Return values:
0 OK
-L4_ENOMEM out of memory

Definition at line 29 of file sched.c.

References sched_max_threads.

Referenced by main().

int sched_prepare_free ( int  pos  ) 

Ask the watcher of a sched-entry to stop and wait for its readiness.

Definition at line 159 of file sched.c.

References sched_cur_threads, sched_t::watcher, and sched_t::watcher_end_sem.

Referenced by l4cpu_reserve_delete_task_component(), and l4cpu_reserve_delete_thread_component().

int sched_response_time ( sched_t sched,
int  from,
sched_t new_ 
)

Get the response time of the thread s.

we do response-time analysis based on the wcet of the higher-prioritized threads with (period T, wcet C) (sometimes called time-demand analysis): Iterative proces: r_j+1 = sum_i { ceil(r_j/T_i)*C_i } until fixpoint is found

Parameters:
sched contains sched params. If found in scheds, it is not included again
from consider all threads at and above pos
new_ a new thread, that is not in scheds yet, but has higher prio than s. maybe 0.
Return values:
>0 response time, <=deadline
-1 respones time would be>deadline

Definition at line 109 of file sched.c.

References sched_t::deadline, get_max_dp(), is_dp(), sched_t::period, sched_t::prio, sched_cur_threads, and sched_t::wcet.

Referenced by l4cpu_reserve_add_component(), l4cpu_reserve_change_component(), l4cpu_reserve_delayed_preempt_component(), and l4cpu_reserve_time_demand_component().

void unlock_scheds ( void   ) 


Variable Documentation

l4_threadid_t main_id

Definition at line 37 of file main.c.

Referenced by main(), and watcher_fn().

l4semaphore_t scheds_lock

Definition at line 22 of file sched.c.

Referenced by lock_scheds(), and unlock_scheds().


CPU reservation server Reference Manual, written by Jork Loeser  © 2004