mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-04 20:31:03 +01:00
if TSC jumps backwards (in case of migration to a different CPU core) latency peak may occur -- fixed
This commit is contained in:
@@ -111,9 +111,11 @@ bool zmq::app_thread_t::process_commands (bool block_, bool throttle_)
|
|||||||
#error
|
#error
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check whether certain time have elapsed since last command
|
// Check whether TSC haven't jumped backwards (in case of migration
|
||||||
// processing.
|
// between CPU cores) and whether certain time have elapsed since
|
||||||
if (current_time - last_processing_time <= max_command_delay)
|
// last command processing. If it didn't do nothing.
|
||||||
|
if (current_time >= last_processing_time &&
|
||||||
|
current_time - last_processing_time <= max_command_delay)
|
||||||
return !terminated;
|
return !terminated;
|
||||||
last_processing_time = current_time;
|
last_processing_time = current_time;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user