How do I solve the concurrency problem
I found that after receiving the packet from the network, the code in the warehouse seems to execute each event in a single step. Is there a high concurrency problem in the library? After the network packet is unwrapped, can each event independently open a coroutine to complete the logic of data acquisition in its own business and then return to the other party?
Currently, the server runs under a single coroutine, so there may be a certain bottleneck in busy traffic.
The server itself is completely stateless, so you can reroute traffic to other coroutines to improve the ability to handle traffic.
As a rule of thumb, most of the CPU consumption will be in OID computation (MIB library).
Hello, that is to say, I need to improve the ability to handle traffic, so I can only modify your library and add coroutines to accelerate the processing of business logic. Your library does not do coroutine forwarding, right?
Thank you for ask, and I would appreciate it if you would like to contribute your implementation.
I added a simple coroutine pool to ensure coroutine processing of transactions. I tested it a little and it seems to be fine. I'm not sure if it triggers any special bugs.
Thank you very much for your contribution. I have carefully considered it, but I still believe that handling concurrency through multiple Goroutines in Golang is the responsibility of the library's users. Therefore, I regret to inform you that I cannot accept this modification.
If you have any feedback or suggestions, or if you would like to provide a demo or sample program, please feel free to engage in further discussion.