I have a program that generates packets to send to the receiver. I need an effective method of introducing a slight delay between sending each packet so as not to intercept the receiver. I tried usleep () and nanosleep (), but they seem too slow. I implemented a closed wait loop and had more success, but this is not the most efficient method I know. I am interested in any experience in trying to do what I do. Do others find usleep () and nanosleep () to work well for this type of application?
Thank,
Danny Llewaln
.
"" (CONFIG_NO_HZ) , , , .
CONFIG_NO_HZ
. (CONFIG_HZ) - , 10 , 4 , 3,3 1 .
CONFIG_HZ
. , , . , , .
, , , () .
, , , , / NOP- .
A NOP , , _NOP() , , nops.
_NOP()
regTX = 0xFF; // Transmit FF on special register // Wait three clock cycles _NOP(); _NOP(); _NOP(); regTX = 0x00; // Transmit 00
Solaris , . 10 , , usleep. , hires_tick = 1 (1 ) hires_hz = /etc/system, .
usleep
hires_tick = 1
hires_hz =
/etc/system
, , , . TCP ? TCP , .
If you have already invested a lot in the packetized approach, you can always use a layer on top of TCP to extract the original data packets from the TCP stream and transfer them to existing functions.
Source: https://habr.com/ru/post/1747371/More articles:Source Management - version-controlJoining the Many to Many Table - c #Program structure during long-term data processing python script - pythonContact Connector in Dialog - javaSimple modification of C strings using pointers - cAt what point should I abandon the Variable table for the Temp table? - sql.NET: How to display a string in HTML format? - .netПочему я не могу добавить свойство Orientation в Style Setter в WPF - c#WPF trigger when property and data value is true - c #Disable holiday list in jQuery date picker - jqueryAll Articles