Linux context switch is 6-7 usec. Usually it is more cache invalidation that causes the whole code to run slow. Usually spinning is the only solution and core/cpu isolation.
> On Apr 9, 2023, at 1:33 PM, TH <tinsk...@gmail.com> wrote: > > Hey, > > I'm building a software which handles hundred-ish concurrent network > communications. I want to build some other parts of core logic in to a > separate process. I've tried to use UDS and pipes, but they all give me ~25µs > (RTT 50µs) latency and sometimes on idle 300µs (RTT 600µs). > > The 25µs is not a big problem, but the big variance in latency is an > uncovenience. Are there any methods to synchronize between two processes with > lower latency jitter? Throughput is not an issue, as I can always use shared > memory to pass big data. But I need a low latency way to signal another > process that new data is in the shared memory. > > I can get it to less than 5µs with spinlock on shared memory, but that's not > a solution as CPU is 100%. Are there any primitives that we could use e.g. > shared futex? Or the context switch is typically that heavy? > > Thanks > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/4e58d2c0-e097-49a3-afe2-af4ddac214f4n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/F106DF3D-371A-4F95-BD5C-D38AFE47052A%40ix.netcom.com.