Categorygithub.com/Exca-DK/go-mempipe
repository
0.0.0-20230318151322-2b64f68d6d95
Repository: https://github.com/exca-dk/go-mempipe.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Experimental one-way messaging through shared memory. Utilizes more resources but has way lower latency in compared to unix socket. On my machine unix latency is around 90μs meanwhile in tests its within few.

memory structure:

                 uint32                           uint32
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |        Sender Counter         |          Recv Counter         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |      MsgSize + CodeSize       |              Code             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    |                            MESSAGE                            |
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

run test in processes as two seperate go instances

cd ./tests

go run test.go --id=1 --server

go run test.go --id=2