The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Well, back when it was Turbo Pascal: Used the bathroom (took a book), got a cup of coffee, chatted up the receptionist (you could do that, then), checked the telex machine, read a bit of Byte magazine and then topped off my coffee again.
Some microcontrollers do not have RTC support or any other kind of timer-like tick coming in so cooperation seems like the best option for them. I seem to remember an article or two here on that topic.
I've also found that introducing multithreading into a system you already can't debug using a traditional debugger is a recipe for a nightmare in practice.
What I've done on this dual core monster I am working with is I keep exactly two threads - each with its own core affinity, and they basically do very little communication with each other, and all of their work is internally cooperatively multitasked.
It doesn't have an RTC per se, but like most CPUs it has a timing crystal connected so you can get the number of milliseconds since boot with it. I use that to make timers.
I have a similar issue. I have a big bunch of code to debug that needs to run on a GPU. I have written it so it can also run on the CPU so I am doing all my initial debugging on the CPU and then I'll try it on the GPU. I have already tried small bits on the GPU and it looks good so far.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
If your mother promises you Eggs Benedict, will you go home for the Hollandaise?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!