My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Wiki  
Updated Feb 21, 2012 by cyfourn...@enseirb-matmeca.fr

Projet System - ENSEIRB-MATMECA 2012


Sujet

voir ici


Conception

typedef struct thread_elt thread_t

struct thread_elt {

struct ucontext context; struct thread_elt next; struct thread_let waiting_begin; void retval;
};

var global: extern struct thread_elt ready_begin; //file des threads ready extern struct thread_elt cursor_ready; //pointe sur le thread courant

thread_self() - renvoie cursor_ready

thread_create(thread1) - créer et ajouter thread1 en tete de ready_begin - linker thread1 vers le contexte actuel - appeler thread_yield()

thread_yield() - sauver le contexte actuel - choisir un thread dans ready_begin et executer son contexte

thread_join(thread1, retval) - si thread1 est vivant: - retirer le thread actuel des ready_begin et le mettre dans waiting_deb du thread1 - sauvegarder contexte actuel

Powered by Google Project Hosting