I am programming a network protocol over UDP using C / C ++ on Linux. The protocol should be reliable, so I'm going to simulate something like TCP retransmission over UDP.
This can be done using pthreads or fork, but I believe this is overkill and consumes a lot of system resources. The best approach is to use a scheduler.
I probably can't use the internal Linux scheduler as I program in user space. Are there standard C / C ++ libraries for this? What about third-party libraries?
Edit: Some people ask why I do this. Why not use TCP instead?
The answer is that I am implementing a tunneling protocol. If someone tunnels TCP through TCP, the efficiency will be significantly reduced. Here is more information. Why TCP over TCP is a bad idea .
source
share