Re: Shared memory IPC in ATS

2018-04-08 Thread Andrew Knapp
Nanomq is as bare-bones as you can possibly get. Unlike zeromq, it only 
works for a small number of local processes, and makes every possible 
tradeoff for low latency.

Nanomq (in the ATS port and original C++) only offers blocking reads in the 
public interface (I'll probably change this), which are implemented via 
spin locks.

Fun fact: nanomq doesn't even use atomics -- with SPSC ring buffers, you 
can get away with only a compiler fence for reads and a store fence for 
writes on x86!

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/de69e1e6-5e85-44de-b93d-5f9505f9171f%40googlegroups.com.


Re: Shared memory IPC in ATS

2018-04-08 Thread gmhwxi

Thanks!

I once tried to use zeromq. For instance, the myserver2 example is
the following directory is based on zeromq:

http://ats-lang.sourceforge.net/EXAMPLE/EFFECTIVATS/http-server/

>>Fair warning: there aren't many scenarios where this design is a good idea

Could you elaborate?

Also, how do you compare zeromq with nanomsg?

On Monday, April 9, 2018 at 1:11:09 AM UTC-4, Andrew Knapp wrote:
>
> Hi all,
>
> I've extracted some ipc code from a larger codebase.
>
> https://github.com/ajknapp/ats-nanomq
>
> It's basically a bunch of SPSC ring buffers in shared memory, and is 
> ported from a C++ library
>
> https://github.com/rigtorp/nanomq
>
> Fair warning: there aren't many scenarios where this design is a good 
> idea, and the code also uses a few more unsafe things than I think would be 
> necessary if I knew ATS better (e.g. the head pointer).
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/a03204ac-baf8-4fb2-bb57-7b13c802dedf%40googlegroups.com.


Re: Shared memory IPC in ATS

2018-04-08 Thread Artyom Shalkhakov
Hi Andrew,

Great to see some C-style ATS code in the wild. Definitelly following this
development!

Make C great again. :-)

2018-04-09 11:11 GMT+06:00 Andrew Knapp :

> Hi all,
>
> I've extracted some ipc code from a larger codebase.
>
> https://github.com/ajknapp/ats-nanomq
>
> It's basically a bunch of SPSC ring buffers in shared memory, and is
> ported from a C++ library
>
> https://github.com/rigtorp/nanomq
>
> Fair warning: there aren't many scenarios where this design is a good
> idea, and the code also uses a few more unsafe things than I think would be
> necessary if I knew ATS better (e.g. the head pointer).
>
> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ats-lang-users/68d837ee-dd85-4f25-b24b-016904922bd4%
> 40googlegroups.com
> 
> .
>



-- 
Cheers,
Artyom Shalkhakov

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAKO6%3DqiMDs8ZEvydSJRzw7NjocOZ4r9Uk_nSQwMgxUzZp6zMOg%40mail.gmail.com.