add possibility of preparing and sending a message #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were using your package successfully before migrating to go 1.14. This version often breaks the ipc.Msgsnd function when used under high frequency and flags 0 (which is a blocking call). As a workaround, we are now using a for cycle where we issue an ipc.Msgsnd with flag ipc.IPC_NOWAIT and if the resulting error is a syscall.EAGAIN we sleep for a bit and try again. This workaround works, but it has the inconvenient of being pretty heavy on memory allocation. This is due to the buffer allocation in ipc.Msgsnd. I have created this repository: https://github.com/peano88/test-ipc-memory to show that
We then worked on a feasible solution, which is the subject of this pull request: it consists of preparing the buffer once and try to send it afterwards. The memprofile in noWaitModified folder of the above repository shows the difference. As a plus, I solved a couple of go vet issues in the test file.