VirtualBox

Changeset 33265 in vbox


Ignore:
Timestamp:
Oct 20, 2010 2:34:58 PM (14 years ago)
Author:
vboxsync
Message:

Main: support simple reusable events coalescing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/EventImpl.cpp

    r31572 r33265  
    825825    uint64_t sinceRead = RTTimeMilliTS() - mLastRead;
    826826    uint32_t queueSize = mQueue.size();
    827     if ( (queueSize > 200) || ((queueSize > 100) && (sinceRead > 60 * 1000)))
     827    if ( (queueSize > 1000) || ((queueSize > 500) && (sinceRead > 60 * 1000)))
    828828    {
    829829        ::RTCritSectLeave(&mcsQLock);
     
    831831    }
    832832
    833     mQueue.push_back(aEvent);
     833
     834    if (queueSize != 0 && mQueue.back() == aEvent)
     835        /* if same event is being pushed multiple times - it's reusable event and
     836           we don't really need multiple instances of it in the queue */
     837        (void)aEvent;
     838    else
     839        mQueue.push_back(aEvent);
     840
    834841    ::RTCritSectLeave(&mcsQLock);
    835842
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