C threading
Thric
Posts: 109
Because the propeller was the first thing I ever programmed I've gotten very accustomed to doing multiple tasks at the same time and because of that reason I've shy ed away from the other one step at a time processors. I was wondering if someone could explain to me how to take the concept of multitasking of the propeller to my computer. I've searched google for some solution but it just confuses me. Currently I'm coding in C using Code Blocks and MinGW as my compiler.
Thanks
Thanks
Comments
The thread paradigm is similar to the propeller's cogs, so you should get the hang of it quickly.
I doubt it would be worthwhile.
It may be possible on a Propeller, but it would all be rather limited in terms of code and space. One would have to create something like an interrupt in code.
In C you can run run multiple codes in multiple COGs just as you can in Spin. Catalina supports the pthreads API as does propgcc I believe. In addition with ProtoThreads or my smaller faster "Heater Threads" you can write multiple tasks that will run in a single COG.
On your PC I'm sure there is a threading API for C under Windows but I'm no Windows programmer. Under Linux I would go straight to the pthreads (POSIX Threads) library functions.
However I like all my code to be cross platform so I would use a toolkit that provides my code with threads on many platforms. My current favorite at the moment is the Qt tool kit. It's for C++ but you could build non-gui console apps with the minimum amount of C++ "object orientedness" used to get the threads running.