Write the routines called “yield” and “run” which cranks up the works (and put them in threads.h). These routines are defined as:
void run()
{ // real code
Curr_Thread = RunQ
ucontext_t parent; // get a place to store the main context, for faking
getcontext(&parent); // magic sauce
swapcontext(&parent, &(Curr_Thread->context)); // start the first thread
}
--
You received this message because you are subscribed to the Google Groups "asu-cse-430" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asu-cse-430+unsubscribe@googlegroups.com.
To post to this group, send email to asu-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/asu-cse-430.
For more options, visit https://groups.google.com/d/optout.
You can use your own, or use/modify the one provided.
Partha Dasgupta,
ASU/CIDSE/Computer Science & Eng.
EMail: par...@asu.edu
http://cactus.eas.asu.edu/partha
On Mon, Feb 26, 2018 at 6:05 PM, <apon...@asu.edu> wrote:
In project two the below instruction is a little unclear. are we supposed to write a run method, or use the one provided as is?Write the routines called “yield” and “run” which cranks up the works (and put them in threads.h). These routines are defined as:
void run()
{ // real code
Curr_Thread = RunQ
ucontext_t parent; // get a place to store the main context, for faking
getcontext(&parent); // magic sauce
swapcontext(&parent, &(Curr_Thread->context)); // start the first thread
}
--
You received this message because you are subscribed to the Google Groups "asu-cse-430" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asu-cse-430...@googlegroups.com.