On 14/02/2022 10:43, Alex Peshkoff via Firebird-devel wrote:
> 
> - AST (yes, 'A'-async is wrong tday, but I use traditional term) processing

That is the part I was missing, thanks.

BTW in thread_db::reschedule() we have:

-----

void thread_db::reschedule()
{
        // Somebody has kindly offered to relinquish
        // control so that somebody else may run

        checkCancelState();

        StableAttachmentPart::Sync* sync =
this->getAttachment()->getStable()->getSync();
        Database* dbb = this->getDatabase();

        if (sync->hasContention())
        {
                FB_UINT64 cnt = sync->getLockCounter();

                EngineCheckout cout(this, FB_FUNCTION);
                Thread::yield();

                while (sync->hasContention() && (sync->getLockCounter() == cnt))
                        Thread::sleep(1);
        }

        checkCancelState();

        Monitoring::checkState(this);

        if (tdbb_quantum <= 0)
                tdbb_quantum = (tdbb_flags & TDBB_sweeper) ? SWEEP_QUANTUM : 
QUANTUM;
}

-----

Should not the checkCancelState() be better inside the "if
(sync->hasContention())" as the no contention case just checked it?


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to