Cog use status
Chuck Rice
Posts: 210
Tried searching for this, but cog and status are just too common.
How can in get information on cogs currently in use, and the max cogs used?
Is it as Hackish as looping to start cogs with a dummy routine till I get a bad return code then free them again? -Chuck-
How can in get information on cogs currently in use, and the max cogs used?
Is it as Hackish as looping to start cogs with a dummy routine till I get a bad return code then free them again? -Chuck-
Comments
COGs are VERY segregated and very few things can be done without their co-operation. There is a chance to shoot them down, but even then you will get no feedback...
http://forums.parallax.com/showthread.php?p=631581
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Don't recall where I ran across this info, but I use
id := cognew ()
and after the last cognew, display 'id' via
Display.dec(id + 1)
I'm using TV_text to display this and lots other values.
Hope this is helpful for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
The code Mike quoted is really nice, so I post it here:
It shows excellent understanding of many Propeller features, but it can be accomplished in other ways as well
---
Edit: Oh, I just see it's by PhiPi
That is exactly what I needed. Thanks! -Chuck-