-
Notifications
You must be signed in to change notification settings - Fork 230
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
We have two int32 counters in the pipe struct, recvs and waits, for tracking concurrent requests on the pipe.
waits will be increased when receiving a request and decreased when the request is finished.
recvs will be increased when a request is finished and never decreased.
For recvs, we don't care if it overflows because we don't care about its actual value but only check if it changes.
For waits, we know it will not overflow because it should stay close to 0.
Can we merge these counters into one uint64 to save atomic operations? For example:
recvs is the upper 32bits and waits is the lower 32bits.
when receiving a request, we increment the uint64 by 1.
when a request is finished, we decrement the uint64 by 1 + 1<<32.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers