Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools: unify I/O semaphores #25017
grepping for the word "semaphore" reveals five separate I/O semaphores in x/tools. Some of them could easily be used in the same executable, e.g. those in
I suggest we add a single exported semaphore to x/tools, which all x/tools packages can import and use, thus providing an actual process-wide limit on I/O concurrency. It could be in an internal package or not; I don't feel strongly.
Great, will do. Anyone want to bikeshed API details before I send a CL? For lack of better names, perhaps:
Allowed concurrency would be fixed at 20.
Usage would look like:
iosem.Acquire() // do work iosem.Release()