"Massage Passing" library?

Hi all, I'm looking for keywords to search for... I have various local peripherals that I need to read and write. From top of my head, I'm thinking 3 ways: 1. Use select(2) (and friends) to round-robin the peripherals. 2. Each peripheral is serviced by a separate thread, and main thread does the business logics. The peripherals don't need to talk to each other (but this may change). 3. Each peripheral is serviced by a separate process, and they pass "messages". This option is what I want to investigate. So, do you know any "message-passing" scheme, framework, or library that I can look up? I'm not talking about OS or kernel level. More at application level. -- William Park <opengeometry@yahoo.ca> .

On 13 September 2017 at 03:24, William Park via talk <talk@gtalug.org> wrote:
I have various local peripherals that I need to read and write. From top of my head, I'm thinking 3 ways:
I'd go with #1, but that's assuming your peripherals are some sort of I/O device. Most I/O usually ends up going through a single channel at some point (a bus, a single cable, a single radio, etc) so having multiple threads/processes doesn't make processing any faster. If you wanted to separate components, you could have one process that uses `select` to read in the data and then passes that data to the components that process it. ZeroMQ is pretty good for fast somewhat low-level message passing. It's similar to OS level things, but you can have them connect over networks and handle the details for you.

On 2017-09-13 03:24 AM, William Park via talk wrote:
3. Each peripheral is serviced by a separate process, and they pass "messages". This option is what I want to investigate.
So, do you know any "message-passing" scheme, framework, or library
You could have a look at the message passing scheme used in the QnX operating system. I don't remember the details as it has been a long time since I used it. From what I remember it had a simple way of passing messages between applications involving only three(?) function calls. -- Cheers! Kevin. http://www.ve3syb.ca/ |"Nerds make the shiny things that distract Owner of Elecraft K2 #2172 | the mouth-breathers, and that's why we're | powerful!" #include <disclaimer/favourite> | --Chris Hardwick

On 2017-09-13 03:24 AM, William Park via talk wrote:
So, do you know any "message-passing" scheme, framework, or library that I can look up?
MQTT seems to be what all the cool kids in IoT are using today. “Mosquitto” <https://mosquitto.org/> seems to be the message broker of choice. cheers, Stewart

On Wed, Sep 13, 2017 at 03:24:25AM -0400, William Park via talk wrote:
I'm looking for keywords to search for...
I have various local peripherals that I need to read and write. From top of my head, I'm thinking 3 ways:
1. Use select(2) (and friends) to round-robin the peripherals.
poll seems more popular these days than select.
2. Each peripheral is serviced by a separate thread, and main thread does the business logics. The peripherals don't need to talk to each other (but this may change).
3. Each peripheral is serviced by a separate process, and they pass "messages". This option is what I want to investigate.
So, do you know any "message-passing" scheme, framework, or library that I can look up? I'm not talking about OS or kernel level. More at application level.
Processes don't get to do anything without OS/kernel support. If you use seperate processes, you will need to use something from the OS/kernel to pass messages. -- Len Sorensen

Also may want to consider libEv or asio (boost if c++)., which wrap the lower levels and also add in features. libEv is great if you want to keep watchers active while servicing many requests as those watchers fire. For messages across processes, i have used signals, locks and shmem to get pretty optimal. With signals and if your design/use allows you may even be able to go lock-free or a quick atomic lock if arch supports it. If thread, you can use lock-free collections (have some in boost, and if c++14/17, may be in standard now). -tl On Wed, Sep 13, 2017 at 2:35 PM, Lennart Sorensen via talk <talk@gtalug.org> wrote:
On Wed, Sep 13, 2017 at 03:24:25AM -0400, William Park via talk wrote:
I'm looking for keywords to search for...
I have various local peripherals that I need to read and write. From top of my head, I'm thinking 3 ways:
1. Use select(2) (and friends) to round-robin the peripherals.
poll seems more popular these days than select.
2. Each peripheral is serviced by a separate thread, and main thread does the business logics. The peripherals don't need to talk to each other (but this may change).
3. Each peripheral is serviced by a separate process, and they pass "messages". This option is what I want to investigate.
So, do you know any "message-passing" scheme, framework, or library that I can look up? I'm not talking about OS or kernel level. More at application level.
Processes don't get to do anything without OS/kernel support. If you use seperate processes, you will need to use something from the OS/kernel to pass messages.
-- Len Sorensen --- Talk Mailing List talk@gtalug.org https://gtalug.org/mailman/listinfo/talk
participants (6)
-
Kevin Cozens
-
lsorense@csclub.uwaterloo.ca
-
Stewart C. Russell
-
ted leslie
-
Tim Tisdall
-
William Park