Shop OBEX P1 Docs P2 Docs Learn Events
Will start_lmm become a standard library function? — Parallax Forums

Will start_lmm become a standard library function?

mindrobotsmindrobots Posts: 6,506
edited 2011-11-20 09:54 in Propeller 1
I'm starting to document the second Toggle Tutorial which is lmm_c_toggle - starting a second LMM engine in its own COG. This example uses the lmm_start function which seems to be a perfect candidate for a standard library routine(provided it is modified to return a COG ID or Error indicator instead of void).

Is that a safe assumption for future releases so the user doesn't need to be burdened with
extern unsigned int _load_start_kernel[];
or the stack manipulation to put the function address onto the stack before calling cognew()?

It would be much nicer to just be able to
start_lmm(do_toggle, cog1_stack + STACK_SIZE);
without needing to put the start_lmm function into your code each time.

This isn't something I want to explain in the tutorials! :smile:

Thanks!

Comments

  • ersmithersmith Posts: 6,100
    edited 2011-11-20 09:54
    Yes. The next release will have a _start_cog_thread function which will do what start_lmm does. It will also have an (incomplete) pthreads library so that you can start threads with standard pthreads functions. As you might imagine, the pthread_create function uses _start_cog_thread internally.

    Eric
Sign In or Register to comment.