VirtualBox

Ignore:
Timestamp:
Dec 2, 2011 10:58:29 AM (13 years ago)
Author:
vboxsync
Message:

laptop -> workstation.

File:
1 edited

Legend:

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

    r39500 r39510  
    3434#include <iprt/assert.h>
    3535#include <iprt/asm.h>
     36#include <iprt/critsect.h>
     37#include <iprt/list.h>
     38#include <iprt/log.h>
     39#include <iprt/mem.h>
    3640#include <iprt/string.h>
    3741#include <iprt/time.h>
    3842#include <iprt/semaphore.h>
    3943#include <iprt/thread.h>
    40 #include <iprt/log.h>
    41 #include <iprt/mem.h>
    4244
    4345#include "internal/req.h"
     
    4547
    4648
     49/*******************************************************************************
     50*   Structures and Typedefs                                                    *
     51*******************************************************************************/
     52typedef struct RTREQPOOLTHREAD
     53{
     54    /** Node in the  RTREQPOOLINT::IdleThreads list. */
     55    RTLISTNODE              IdleNode;
     56    /** Node in the  RTREQPOOLINT::WorkerThreads list. */
     57    RTLISTNODE              ListNode;
     58
     59    /** The submit timestamp of the pending request. */
     60    uint64_t                uPendingNanoTs;
     61    /** When this CPU went idle the last time. */
     62    uint64_t                uIdleNanoTs;
     63    /** The number of requests processed by this thread. */
     64    uint64_t                cReqProcessed;
     65    /** Total time the requests processed by this thread took to process. */
     66    uint64_t                cNsTotalReqProcessing;
     67    /** Total time the requests processed by this thread had to wait in
     68     * the queue before being scheduled. */
     69    uint64_t                cNsTotalReqQueued;
     70    /** The CPU this was scheduled last time we checked. */
     71    RTCPUID                 idLastCpu;
     72
     73    /** The thread handle. */
     74    RTTHREAD                hThread;
     75
     76    /** The submitter will put an incoming request here when scheduling an idle
     77     * thread.  */
     78    PRTREQINT volatile      pTodoReq;
     79    /** The request the thread is currently processing. */
     80    PRTREQINT volatile      pPendingReq;
     81
     82} RTREQPOOLTHREAD;
     83
     84typedef struct RTREQPOOLINT
     85{
     86    /** Magic value (RTREQPOOL_MAGIC). */
     87    uint32_t                u32Magic;
     88
     89    /** The current number of worker threads. */
     90    uint32_t                cCurThreads;
     91    /** The maximum number of worker threads. */
     92    uint32_t                cMaxThreads;
     93    /** The number of threads which should be spawned before throttling kicks
     94     * in. */
     95    uint32_t                cThreadsThreshold;
     96    /** The minimum number of worker threads. */
     97    uint32_t                cMinThreads;
     98    /** The number of milliseconds a thread needs to be idle before it is
     99     * considered for retirement. */
     100    uint32_t                cMsMinIdle;
     101
     102    /** Statistics: The total number of threads created. */
     103    uint32_t                cThreadsCreated;
     104    /** Statistics: The timestamp when the last thread was created. */
     105    uint64_t                uLastThreadCreateNanoTs;
     106    /** Linked list of worker threads. */
     107    RTLISTANCHOR            WorkerThreads;
     108
     109    /** Critical section serializing access to members of this structure.  */
     110    RTCRITSECT              CritSect;
     111
     112    /** Reference counter. */
     113    uint32_t volatile       cRefs;
     114    /** Linked list of idle threads. */
     115    RTLISTANCHOR            IdleThreads;
     116
     117
     118} RTREQPOOLINT;
     119/** Pointer to a request thread pool instance. */
     120typedef RTREQPOOLINT *PRTREQPOOLINT;
     121
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