VirtualBox

Changeset 103547 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 23, 2024 3:23:03 PM (11 months ago)
Author:
vboxsync
Message:

Runtime/reqpool.cpp: Another place where we need to decrement the idle thread count or exiting idle threads would still have one idle reference. Also spawn a new thread if the number of pending requests is greater than the number of idling threads (each one can only handle on request at a time and depending on the processing time of each request others might get delayed too much)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/reqpool.cpp

    r103543 r103547  
    439439            uint64_t cNsIdle = RTTimeNanoTS() - pThread->uIdleNanoTs;
    440440            if (cNsIdle >= pPool->cNsMinIdle)
     441            {
     442                ASMAtomicDecU32(&pPool->cIdleThreads); /* Was already marked as idle above. */
    441443                return rtReqPoolThreadExit(pPool, pThread, true /*fLocked*/);
     444            }
    442445        }
    443446
     
    580583     * maximum number of worker threads, we're done.
    581584     */
    582     if (   pPool->cIdleThreads > 0
     585    if (   pPool->cIdleThreads >= pPool->cCurPendingRequests
    583586        || pPool->cCurThreads >= pPool->cMaxThreads)
    584587    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette