Events and Messages

  • Tom Barclay

    Tom Barclay - 2012-10-18

    I have looked at the FunkOS3.0 docs and am a bit confused. It seems that the EVENT object has been overtaken by the MESSAGE object and is now merely part of the MESSAGE struct.

    Why ?.  It is quite useful to have EVENTS as messages of zero length but to use a MESSAGE  object of zero length seems expensive. 

    Another point of confusion is … Task creation … to do this you must
         1) declare a struct
         2) create the task
         3) add the task
         4) start the task
         Since 2->4 all occur in sequence and before the scheduler actually runs why not roll it all into 1 function ???

    I am looking at using it on and AVR XMega 256. Any comments

  • moslevin

    moslevin - 2012-11-02

    I think the original idea was that a user could use the heap to allocate a block of data to attach to the MESSAGE struct by the sender, which could be freed by the receiver.  I probably made the change after reading some article on and thought it was a good idea.

    The reason why I've broken down task creation into separate create/add/start stages is that the kernel supports adding tasks at runtime - there may be cases where you'd want to create a thread in the 'stopped' state, and in order to achieve this you need to have at least a separate "start" function.

    As far as using FunkOS on an Xmega256 - these parts are a bit tricky; you may have to do some hacking around the port code to add extra register context (thread init and context switch), and remap the SWI and Timer functionaity.  I'd certainly recommend FunkOS on the regular mega's - but the xmega adds a lot of extra complexity that an RTOS can mess up. 


Log in to post a comment.