Synchronization objects

nobody wrote on Tuesday, April 04, 2006:

on 32bit cpu semaphore takes 100 bytes in ram!
it very expansive.
it would very good if freertos would have like window’s  Event and Semaphore objects.

rtel wrote on Tuesday, April 04, 2006:

The semaphore uses exactly the same code as the queue mechanism - it is just a macro wrapper around the queue code.  This is done to minimise the ROM usage, rather than the RAM.

While the RAM usage may seem high for a semaphore the data structures within that 100 bytes contains all the event management data in addition to the semaphore data.  There are no extra event control blocks required, and event data structures are not required to be allocated separately as in some other RTOS’s.  This (hopefully) is more efficient when looking at the system as a whole, rather than individual components.  At least this is the intention :slight_smile:


imajeff wrote on Tuesday, April 04, 2006:

The preference seems questionable to me… I’ve always seen that ROM was much more plentiful than RAM inside the MCU families I’m using (8 and 16-bit Freescale).

But then, I’ve been impressed by the overall system, so Richard makes a good point.