Giter Club home page Giter Club logo

tinymq's Introduction

tinymq

VxWorks-like lightweight message queue for Windows

The tinymq implements the functions about a message queue which is similar with the Wind River VxWorks kernel message queue.

The memory architecture for tinymq message queue:


----------------   -----------------------------------------------------------
| local memory |-->|                     shared memory                       |
----------------   -----------------------------------------------------------
       ^                                     ^
       |                                     |
----------------   -----------------------------------------------------------
|    MSG_Q     |   | MSG_SM | MSG_NODE list |       message queue data       |
----------------   -----------------------------------------------------------
                                    ^                         ^
                                    |                         |
             ---------------------------------------------    |
             | MSG_NODE1 | MSG_NODE2 | ... | MSG_NODE(N) |    |
             ---------------------------------------------    |
                                                              |
                                              ---------------------------------
                                              | data1 | data2 | ... | data(N) |
                                              ---------------------------------

The message queue is divided into two parts in memory, they are local memory and shared memory, and these two parts are not closed by. The local memory can be accessed in an process, also can be accessed between threads in a process. The shared memory can be accessed between threads in a process if the message queue name is NULL; or can be accessed between processes if the message queue name is not NULL.

For each tinymq, the structure MSG_Q which desribe the header of the queue is stored in local memory; and the structure MSG_SM, MSG_NODE list and message queue data are stored in shared memory.

The structure MSG_Q saves the kernel objects handlers and the shared memory address; MSG_SM saves the message queue attributes; MSG_NODE list saves all the nodes for the message queue, and each node saves the attributes of a message; the message queue data area saves the data for all the messages.

tinymq's People

Contributors

gushengyuan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.