TODO!
This commit is contained in:
parent
98193d6500
commit
6ea1c8d0dd
1 changed files with 11 additions and 4 deletions
15
src/sched.c
15
src/sched.c
|
@ -48,6 +48,9 @@ int sched_init_cleanup(int);
|
||||||
/* sched_spawn sur un coeur spécifique */
|
/* sched_spawn sur un coeur spécifique */
|
||||||
int sched_spawn_core(taskfunc, void *, struct scheduler *, int);
|
int sched_spawn_core(taskfunc, void *, struct scheduler *, int);
|
||||||
|
|
||||||
|
/* Récupère l'index du thread courant */
|
||||||
|
int current_thread(void);
|
||||||
|
|
||||||
int
|
int
|
||||||
sched_init(int nthreads, int qlen, taskfunc f, void *closure)
|
sched_init(int nthreads, int qlen, taskfunc f, void *closure)
|
||||||
{
|
{
|
||||||
|
@ -201,11 +204,15 @@ sched_init_cleanup(int ret_code)
|
||||||
int
|
int
|
||||||
sched_spawn(taskfunc f, void *closure, struct scheduler *s)
|
sched_spawn(taskfunc f, void *closure, struct scheduler *s)
|
||||||
{
|
{
|
||||||
// TODO: trouver le coeur actuelle, car on ajoute toujours
|
// On ajoute la tâche sur la pile du thread courant
|
||||||
// "une nouvelle tâche dans la même pile"
|
return sched_spawn_core(f, closure, s, current_thread());
|
||||||
int core = 0;
|
}
|
||||||
|
|
||||||
return sched_spawn_core(f, closure, s, core);
|
int
|
||||||
|
current_thread()
|
||||||
|
{
|
||||||
|
/* TODO: Récupère le thread courant */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Reference in a new issue