Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1164 
was reviewed by Joel Sherrill

--
  
Joel Sherrill commented on a discussion on 
cpukit/include/rtems/score/coremsg.h: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1164#note_148595

 > +typedef struct {
 > +  CORE_message_queue_Control   Base;
 > +  Priority_bit_map_Control     Queue;

The _sizeof(Chain_Control)_ is 12 on 32-bit architectures and 24 on 64-bit ones 
for 384 or 768 bytes per message queue. That is just excessive and optimising 
it is still going to result in a custom data structure. Using the Red Black 
tree adds no new data structures to the RTEMS score/. The Red Black tree is 
already used for multiple purposes including priority blocking thread queues 
which are already part of the base capability set.

Red Black Tree operations worst case is log2(N) where N would be the number of 
message priorities. That's a constant in this case. If we stick to 32 maximum 
priorities, the worst case is 5 comparisons. Huge performance improvement with 
minimal impact on memory usage.


-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1164
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to