Projekt

Allgemein

Profil

Feature #450

Von Maximilian Seesslen vor 8 Monaten aktualisiert

Use an m_top/m_entries approach.
Would not be thread-save. Additional counter needed.
Round-Counter-Bit would help.

Full-bit. Only writer can set it. Reader clears it after dropping a value.
Writer has to finish before reader would drop all content. Otherwise
an empty list is marked full.

Stashed bit.
Only the producer knows about this. It can prefill the last element.
On the next write it can increase the write position (twice).

bool pushable()
{
return( ! m_stashed );
}

bool pushEntry()
{
if(m_stashed)
{
qCritical()
return( false );
}
bool m_wouldStash=wouldStash();
m_value[pos]
}

prefab

Zurück