FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2009 Threads] Queues and SemaphoresPosted by Bonanza35 on January 7, 2009 We're in a severe RAM crunch on a project, and are looking for ways to free up some RAM. There are some places where queues are used where they aren't really needed, and semaphores would work just as well. So, I started looking at the effects of replacing a few queues with semaphores.
Then I discovered that a semaphore is just another kind of queue, and the memory overhead is the same (76 bytes, IIRC).
Isn't there a better way to implement semaphores that won't use up quite as much memory?
RE: Queues and SemaphoresPosted by MEdwards on January 7, 2009 There it is just a trade off between ROM and RAM. Semaphores are implemented so they add nothing to the code size by reusing the queue. Semaphores are free as far as ROM is concerned.
Most of the RAM overhead is part of the event control. That is how the tasks are blocked and unblocked. Some RTOS use separate semaphore and event control structures, but add the two together and there is the same usage.
RE: Queues and SemaphoresPosted by Dmitriy A. Cherepanov on January 8, 2009 Year ago I had such question too. And I had try to write a binary semaphore. You can see it on http://freertos.narod.ru/.
It use less ram. Actually it consist only from one List. This mean that xList == xMySemaphoreImplementationStructure. It is a pity but I did not test it very well, but this variant of semaphores worked in PC demo tests instead of original variant. So you can try to use it. May be Richard or somebody else will do some attention to this sources.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|