Hi Matt,

Glad to hear others are experimenting with message-based systems! I did
some work together with Moritz on the zmq egg and I wrote the nanomsg egg.

The main reason I wanted to try nanomsg was that it offers Level-triggered
Polling <http://nanomsg.org/documentation-zeromq.html>. This allows us to
do thread-wait-for-i/o
<https://github.com/Adellica/chicken-nanomsg/blob/master/nanomsg.scm#L140> on
a nanomsg-socket, waiting for a message while other Chicken threads are
running. We couldn't solve this with zmq because the zmq_poll C call (just
like all C calls) would block the Chicken world. Nanomsg is also smaller
than zmq, and written in C, which makes it a little more manageable I
think. Creating bindings for nanomsg was a breeze.

Problems with nanomsg is, of course, that it has a smaller community and is
much less tested etc. We are still just about to test if nanomsg can solve
some of our IPC needs for a commercial project.

When it comes to memory management, it's tricky. I recommend you do like
Thomas Chust suggests: have zmq allocate message, copy into Scheme object,
free zmq message. Perhaps not the fastest, but it's correct and relatively
easy to get right.

Keep us updated on your messaging adventures!
K.

On Fri, Mar 6, 2015 at 2:30 AM, Matt Gushee <[email protected]> wrote:

>
>
> On Thu, Mar 5, 2015 at 6:18 PM, Dan Leslie <[email protected]> wrote:
>
>>
>> You might want to consider the nanomsg egg, which doesn't appear to have
>> a wiki page yet.
>>
>> https://github.com/Adellica/chicken-nanomsg
>>
>
> Oh, great, yet another alternative to consider! :-/  Well, maybe. I've
> never heard of nanomsg before. Any idea how widely-used/well-supported it
> is?
>
> PS: I still think the future of the zmq egg should be addressed, even if I
> end up not using it. It doesn't seem very useful to have a library binding
> that is two major versions behind. Unless someone is using it in
> production, I'd say it should either be updated or withdrawn.
>
> Matt
>
> _______________________________________________
> Chicken-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to