mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-31 01:43:02 +08:00
Merge branch 'maint'
* maint: if TSC jumps backwards (in case of migration to a different CPU core) latency peak may occur -- fixed Conflicts: src/app_thread.cpp
This commit is contained in:
commit
7d5061798c
@ -647,9 +647,11 @@ int zmq::socket_base_t::process_commands (bool block_, bool throttle_)
|
||||
#else
|
||||
#error
|
||||
#endif
|
||||
// Check whether certain time have elapsed since last command
|
||||
// processing. If it didn't do nothing.
|
||||
if (current_time - last_processing_time <= max_command_delay)
|
||||
// Check whether TSC haven't jumped backwards (in case of migration
|
||||
// between CPU cores) and whether certain time have elapsed since
|
||||
// last command processing. If it didn't do nothing.
|
||||
if (current_time >= last_processing_time &&
|
||||
current_time - last_processing_time <= max_command_delay)
|
||||
return 0;
|
||||
last_processing_time = current_time;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user