mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 08:41:31 +00:00
[idd] scheduler: fold late forces into cadence
Treat a forced publication as periodic once the normal pre-deadline send point is due. This prevents an immediate forced copy from being followed by another copy for the same cadence slot.
This commit is contained in:
@@ -495,27 +495,28 @@ bool CFrameScheduler::GetPublishTarget(uint64_t now, uint64_t& target,
|
||||
schedule = m_schedule;
|
||||
republish = m_republishNext;
|
||||
|
||||
const uint64_t safety =
|
||||
max(MIN_SAFETY_NS, m_workEstimate / 8);
|
||||
const uint64_t lead =
|
||||
m_schedule.targetSlack + m_workEstimate + safety;
|
||||
const uint64_t periodicTarget = m_nextDeadline > lead ?
|
||||
m_nextDeadline - lead : now;
|
||||
|
||||
if (m_forceNext)
|
||||
{
|
||||
periodic = m_nextDeadline <= now;
|
||||
periodic = periodicTarget <= now;
|
||||
ReleaseSRWLockExclusive(&m_lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
periodic = true;
|
||||
if (m_nextDeadline <= now)
|
||||
if (periodicTarget <= now)
|
||||
{
|
||||
ReleaseSRWLockExclusive(&m_lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
const uint64_t safety =
|
||||
max(MIN_SAFETY_NS, m_workEstimate / 8);
|
||||
const uint64_t lead =
|
||||
m_schedule.targetSlack + m_workEstimate + safety;
|
||||
target = m_nextDeadline > lead ? m_nextDeadline - lead : now;
|
||||
if (target < now)
|
||||
target = now;
|
||||
target = periodicTarget;
|
||||
ReleaseSRWLockExclusive(&m_lock);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user