Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes to message queues #2432

Closed
zephyrbot opened this issue Sep 16, 2016 · 2 comments
Closed

API changes to message queues #2432

zephyrbot opened this issue Sep 16, 2016 · 2 comments
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 16, 2016

Reported by Benjamin Walsh:

A potpurri of message queue-related enhancements:

  • Change "number of items used" API to "amount of space free" API, since the latter is more useful. (Or else support both?)
    
  • Figure out how best to track # of slots in a message queue.
    

** Use uint16_t's, since a queue isn't likely to have more that 64K items?
** Compute the usage from the start and end pointers, and avoid the need for extra variables?

  • Allow users to specify alignment of message queue items. (Requires an extra argument during initialization.)
    

** Need to decide how to handle cases where alignment would cause a gap between items . (Do we allow this or force the user to ensure that item size is a multiple of alignment?)

(Imported from Jira ZEP-925)

@zephyrbot
Copy link
Collaborator Author

by Peter Mitsis:

  1. See https://gerrit.zephyrproject.org/r/#/c/5339/ for the patch that adds k_msgq_freespace_get().

  2. Not going to change how the slots are tracked. Using a uint16_t may save a few bytes in the structure, but can cost more in terms of instructions. For example, on the x86 accessing 16-bit operands requires a special opcode prefix.

  3. See https://gerrit.zephyrproject.org/r/#/c/5290/ for the patch that adds an alignment parameter to K_MSGQ_DEFINE().

@zephyrbot
Copy link
Collaborator Author

by Sharron LIU:

msg queue verified @x86 @arc @arm on below test points:
/*TESTPOINT: init via K_MSGQ_DEFINE/
/*TESTPOINT: init via k_msgq_init/
/*TESTPOINT: thread-thread data passing via message queue/
/*TESTPOINT: thread-isr data passing via message queue/
/*TESTPOINT: msgq free get/
/*TESTPOINT: msgq used get/
/*TESTPOINT: msgq purge/
/*TESTPOINT: msgq purge while another thread waiting to put msg/
/*TESTPOINT: msgq put returns -ENOMSG/
/*TESTPOINT: msgq put returns -EAGAIN/
/*TESTPOINT: msgq get returns -ENOMSG/
/*TESTPOINT: msgq get returns -EAGAIN/

Closing this. Thanks.

@zephyrbot zephyrbot added priority: high High impact/importance bug area: Kernel Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.6.0 milestone Sep 23, 2017
@zephyrbot zephyrbot mentioned this issue Sep 23, 2017
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

1 participant