when to use task_create?

Started by names_are_hard, July 07, 2019, 06:09:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I'm doing some work on logging in my 200D port and I'm confused by the advantages of task_create.  Can someone explain the difference between these two examples?



    task_create("do_stuff", 0x1e, 0x1000, do_stuff, 0 );   

Is the benefit on the second case related to blocking, because tasks go in a queue?  Is that all there is?


If you start do_stuff() the first way, it will obviously execute in the same task.

If you launch it as a new task, it will run independently, in parallel. Also, you get to specify the task priority (0x1e), and the amount of stack space (0x1000).


Thanks, that's mostly how I guessed (hadn't considered the priority).  I think I know the right way to do what I want.