Shop OBEX P1 Docs P2 Docs Learn Events
COGINIT - -> Newcog — Parallax Forums

COGINIT - -> Newcog

Suppose one might presume that coginit(newcog... would start the first free cog starting from cog=0.
I.e., filling the bottom first.

But, if one first starts a cog with a later number, say 5 with coginit(5...
Appears that the next newcog will be 6

At least, that is how it is looking. Just something interesting, maybe doesn't matter that much...

Comments

  • JonnyMacJonnyMac Posts: 9,566
    edited 2025-12-26 17:16

    Turns out not to be the case -- at least with my simple experiment. It seems to select the first available starting from cog 0.

  • RaymanRayman Posts: 15,925

    Hmm... Maybe I'm wrong, have to investigate some more...

  • evanhevanh Posts: 17,032
    edited 2025-12-26 20:13

    The symbol is COGEXEC_NEW
    EDIT: Never mind, I see they are the same numerical values. In fact I didn't know NEWCOG existed until now.

  • JonnyMacJonnyMac Posts: 9,566
    edited 2025-12-26 20:19

    I use cogexec_new but wanted to match Ray's question -- and did after verifying that newcog and cogexec_new have the same value.

Sign In or Register to comment.