![]() The above description of the FreeRTOS semaphore, with the optional tracing structure members, I have just measured to take 80 bytes on a 32-bit architecture, not the >100 bytes you have measured, so I don’t know what it is you are measuring. ![]() Many OSes will allocated separate event management structures. Therefore, when you say CoOS uses 16 bytes, I doubt very much you are comparing like for like, as there cannot be all that functionality in the semaphore structure, so presumably either the functionality is not the same or the data associated with the functionality is simply somewhere else. The semaphores include all the event management, including a highly efficient and ordered linked list of tasks that are blocked on the semaphore waiting to obtain the semaphore, a highly efficient and ordered linked list of tasks that are blocked on the semaphore waiting to give the semaphore, a count of the number of semaphores available (where the semaphore is of counting type), lock variables that allow the semaphore to be used from within interrupts and tasks simultaneously without causing corruption, plus some optional variables used for tracing, etc. It also allows FreeRTOS semaphores to be implemented with practically no impact on code size at the expense of a few structure members being redundant when the structure happens to represent a semaphore. Engineering is almost by definition about finding the best compromise because you cannot optimise all attributes at once – you can only trade off by optimising one attribute at the expense of another.įreeRTOS has just one central primitive that is re-used to provide lots of functionality – meaning that central primitive extremely well tested and robust. Software has many attributes, and trying to draw a comparison by looking at just one while ignoring the others just doesn’t work.įor example, code size, testability, correctness, robustness, code reuse, design, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |