Multithreading is generally handled by the OS, not the parent program
I understand this part easy enough as the os has to control its own threads plus start a new thread for programs that are run, I Thought the example was a bit more illustrative to what i wanted
Multithreading can be easily used in C by calling special functions that start new threads.
I didnt know C itself had this functionality (i thought it came in with c+) I'll have to investigate further
What OS are you using? What CPU? Is it a microcontroller? What are you trying to do? Maybe there's a way to do it without multithreading.
I am using microcontrollers, i have a few different pic's and avr's to choose from. Basically what i am doing is trying to keep evereything modular based using a small 8 pin pic to control motor h bridges - an avr to control an ir range finder, the scanning servo its mounted on and a sonar range finder, Ive also had to use a pic to control an lcd screen as the one im using is not serial or i2c compatable and needs either 4bit or 8bit interface, so this pic is acting as an i2c slave device and then relays the data to the lcd in 4 bit mode.
These are all controlled by a central processing pic16f877a(for now) also the pic with the lcd i have given i2c functions that allow its excess ram to be by the central processing pic for extra datastorage.
I am soon to be installing another ir rangefinder and servo onto the avr so there would be 2 of each. I know i can just code these in as normal but i would rather try to use multithreading type abilities (just to see if they work) since i am designing an ai architecture thats running on my simulator that needs multithreading, this will eventually be added as an advanced daughter board.