« first day (2371 days earlier)      last day (57 days later) » 

2:32 AM
hey guys I'm trying to add a scheduler function called scheduler to choose the next thread to run. So I need to ensure that all
thread states are correct. e.g. Threads which have completed have their state changed to FINISHED, threads
which are waiting to run are READY and only the currently executing thread is RUNNING. this is my Current code pastebin.com/DrGRdniE
I just need tips on how to start , this is C programming btw :p
 
@ross.c you're still leaving out critical details, like the fact that your threads are implemented using setjmp/longjmp
 
void scheduler () {

if(threads -> state == READY) {
	switcher();
}
else if (threads -> state == FINISHING) {

	}

}
I wrote this now as a small template
 
well threads are a complicated topic, there's no denying that
 
2:47 AM
yeah :(
So I'm assuming that when the thread is ready as shown above I just called the switcher function but I'm not sure what parameters to put inside it
 
 
4 hours later…
7:04 AM
anyone know why my "bye" doesn't get printed ? I think its something wrong with my scheduler function pastebin.com/XEuUVL5k
 
7:31 AM
8 messages moved from Lounge<C++>
 

« first day (2371 days earlier)      last day (57 days later) »