VirtualBox

Changeset 5798 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 19, 2007 8:40:33 PM (17 years ago)
Author:
vboxsync
Message:

more work on async completion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMInternal.h

    r5791 r5798  
    2929#ifdef IN_RING3
    3030# include <iprt/thread.h>
     31#endif
     32
     33/* For the async completion stuff */
     34#if defined(RT_OS_WINDOWS)
     35# include <windows.h>
     36#elif defined(RT_OS_OS2)
     37/** @todo */
    3138#endif
    3239
     
    762769} PDMASYNCCOMPLETIONTYPE;
    763770
    764 typedef struct PDMASYNCCOMPPLETION
     771typedef struct PDMASYNCCOMPLETION
    765772{
    766773    /** Pointer to the next completion task in the list. */
    767774    struct PDMASYNCCOMPLETION              *pNext;
     775    /** Pointer to the previous completion task in the list. */
     776    struct PDMASYNCCOMPLETION              *pPrev;
    768777    /** The completion template for this task. */
    769778    R3PTRTYPE(PPDMASYNCCOMPLETIONTEMPLATE) pTemplate;
     779    /** The thread this task is assigned to. */
     780    R3PTRTYPE(PPDMTHREAD)                  pThread;
    770781    /** Completion task type. */
    771782    PDMASYNCCOMPLETIONTYPE                 enmType;
     
    852863    PDMASYNCIOTYPE                          enmType;
    853864    /** Pointer to the VM. */
    854     R3R0PTRTYPE(PVM)                        pVMHC;
     865    R3PTRTYPE(PVM)                          pVMHC;
    855866    /** Use count of the template. */
    856867    uint32_t                                cUsed;
    857     /** Head of the tasks associated with this template. (singly linked) */
    858     R3PTRTYPE(PPDMASYNCCOMPLETION)      pAsyncCompletionTasksHead;
    859     /** Tail of the tasks associated with this template. */
    860     R3PTRTYPE(PPDMASYNCCOMPLETION)      pAsyncCompletionTasksTail;
    861868} PDMASYNCCOMPLETIONTEMPLATE;
     869
     870/** Pointer to the main PDM Async completion structure. */
     871typedef struct PDMASYNCCOMPLETIONMANAGER *PPDMASYNCCOMPLETIONMANAGER;
     872
     873/**
     874 * Structure for managing one async task thread.
     875 */
     876typedef struct PDMASYNCCOMPLETIONMANAGER
     877{
     878    /** Next element in the list. (singly linked) */
     879    R3PTRTYPE(struct PDMASYNCCOMPLETIONMANAGER) *pNext;
     880    /** The type of the thread. */
     881    PDMASYNCCOMPLETIONTYPE                      enmType;
     882    /** The thread which manages tasks. */
     883    R3PTRTYPE(PPDMTHREAD)                       pThread;
     884    /** List of new tasks since last notification of the socket task thread. */
     885    R3PTRTYPE(PPDMASYNCCOMPLETION)              pTasksNew;
     886    /** Type specific data. */
     887    union
     888    {
     889        /** Socket connection for waking up the thread. */
     890        /** @todo */
     891#if defined(RT_OS_LINUX) && defined(_AIO_H)
     892        /** Pipe for waking up the thread on linux hosts. */
     893        int                                     WakeupPipe[2];
     894#elif defined(RT_OS_WINDOWS)
     895        /** Handle for waking up the thread on windows hosts. */
     896        HANDLE                                  WakeupHandle;
     897#elif defined (RT_OS_OS2)
     898        /** @todo */
     899#endif
     900    } u;
     901} PDMASYNCCOMPLETIONMANAGER;
    862902
    863903/**
     
    934974#endif
    935975
    936     /** Head of the PDM async completion templates. (singly linked) */
    937     R3PTRTYPE(PPDMASYNCCOMPLETIONTEMPLATE) pAsyncCompletionTemplates;
    938 
    939976    /** Head of the PDM Thread list. (singly linked) */
    940977    R3PTRTYPE(PPDMTHREAD)           pThreads;
    941978    /** Tail of the PDM Thread list. (singly linked) */
    942979    R3PTRTYPE(PPDMTHREAD)           pThreadsTail;
     980
     981    /** Head of the asychronous tasks managers. (singly linked) */
     982    R3PTRTYPE(PPDMASYNCCOMPLETIONMANAGER) pAsyncCompletionManagerHead;
     983    /** Head of the templates. (singly linked) */
     984    R3PTRTYPE(PPDMASYNCCOMPLETIONTEMPLATE) pAsyncCompletionTemplates;
    943985
    944986    /** TEMPORARY HACKS FOR NETWORK POLLING.
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