Stack Pointers...

Status
You're currently viewing only panto's posts. Click here to go back to viewing the entire thread.
Not open for further replies.

panto

Wise, Aged Ars Veteran
115
Well by using pthreads you already have the threads.

I'm afraid that the prof wants you to do it
within the context of only one process and
use longjmp/setjmp to switch around the tasks.
It is doable if you do cooperative multitasking.
Do a search about "cthreads", they work in the same way.

Regarding the getch() function and other stuff, what
you want to use is ncurses. Try man ncurses.

And another thing about the mangled output.
You will only get this problem when you're using
pthreads; you must protect the output functions you use with a mutex.
In a C++ context I think that you must overload the << operator
on streams to do that (but it will be slow). Not worth the bother IMO.
 
Status
You're currently viewing only panto's posts. Click here to go back to viewing the entire thread.
Not open for further replies.