VirtualBox

Changeset 26447 in vbox


Ignore:
Timestamp:
Feb 11, 2010 5:05:19 PM (15 years ago)
Author:
vboxsync
Message:

Webservice: add #ifdef'd broken COM event queue processing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r26409 r26447  
    6060// include generated namespaces table
    6161#include "vboxwebsrv.nsmap"
     62
     63// If this is defined, then thread 1 ONLY performs COM event queue processing
     64// (using RT_INDEFINITE_WAIT to wait for events), and the SOAP queue is processed
     65// on a separate thread. This appears to be broken
     66// as soon as more than one client fires SOAP events at the webservices.
     67// If this is NOT defined, then COM events are only serviced after SOAP event
     68// processing has completed, and both occur on thread 1.
     69
     70// #define TEMP_USE_BROKEN_XPCOM_EVENTQUEUE_PROCESSING
    6271
    6372/****************************************************************************
     
    526535        g_pSoapQ = new SoapQ(&soap);
    527536
    528         // start the SOAP processing thread
    529 
    530537        for (uint64_t i = 1;
    531538             ;
     
    545552            WebLog("Request %llu on socket %d queued for processing (%d items on Q)\n", i, s, cItemsOnQ);
    546553
     554#ifndef TEMP_USE_BROKEN_XPCOM_EVENTQUEUE_PROCESSING
    547555            // process the COM event Q
    548556            int vrc = com::EventQueue::getMainEventQueue()->processEventQueue(0);
     557#endif
    549558        }
    550559    }
     
    552561}
    553562
     563#ifdef TEMP_USE_BROKEN_XPCOM_EVENTQUEUE_PROCESSING
    554564/**
    555565 * Thread function for the "queue pumper" thread started from main(). This implements
     
    557567 * SOAP queue worker threads.
    558568 */
    559 // int fntQPumper(RTTHREAD ThreadSelf, void *pvUser)
    560 // {
    561 //     // store a log prefix for this thread
    562 //     g_mapThreads[RTThreadSelf()] = "[ P ]";
    563 //
    564 //     doQueuesLoop();
    565 //
    566 //     return 0;
    567 // }
     569int fntQPumper(RTTHREAD ThreadSelf, void *pvUser)
     570{
     571    // store a log prefix for this thread
     572    g_mapThreads[RTThreadSelf()] = "[ P ]";
     573
     574    doQueuesLoop();
     575
     576    return 0;
     577}
     578#endif
    568579
    569580/**
     
    720731    g_pSessionsLockHandle = new util::RWLockHandle(util::LOCKCLASS_OBJECTSTATE);
    721732
     733#ifdef TEMP_USE_BROKEN_XPCOM_EVENTQUEUE_PROCESSING
    722734    // SOAP queue pumper thread
    723 //     RTTHREAD  tQPumper;
    724 //     if (RTThreadCreate(&tQPumper,
    725 //                        fntQPumper,
    726 //                        NULL,        // pvUser
    727 //                        0,           // cbStack (default)
    728 //                        RTTHREADTYPE_MAIN_WORKER,
    729 //                        0,           // flags
    730 //                        "SoapQPumper"))
    731 //     {
    732 //         RTStrmPrintf(g_pStdErr, "[!] Cannot start SOAP queue pumper thread\n");
    733 //         exit(1);
    734 //     }
     735    RTTHREAD  tQPumper;
     736    if (RTThreadCreate(&tQPumper,
     737                       fntQPumper,
     738                       NULL,        // pvUser
     739                       0,           // cbStack (default)
     740                       RTTHREADTYPE_MAIN_WORKER,
     741                       0,           // flags
     742                       "SoapQPumper"))
     743    {
     744        RTStrmPrintf(g_pStdErr, "[!] Cannot start SOAP queue pumper thread\n");
     745        exit(1);
     746    }
     747#endif
    735748
    736749    // watchdog thread
     
    752765    }
    753766
     767#ifdef TEMP_USE_BROKEN_XPCOM_EVENTQUEUE_PROCESSING
     768    com::EventQueue *pQ = com::EventQueue::getMainEventQueue();
     769    while (1)
     770    {
     771        // we have to process main event queue
     772        WebLog("Pumping COM event queue\n");
     773        int vrc = pQ->processEventQueue(RT_INDEFINITE_WAIT);
     774        if (FAILED(vrc))
     775            com::GluePrintRCMessage(vrc);
     776    }
     777#else
    754778    doQueuesLoop();
    755 
    756 //     while (1)
    757 //     {
    758 //         // we have to process main event queue
    759 //         WebLog("Pumping COM event queue\n");
    760 //         int vrc = com::EventQueue::getMainEventQueue()->processEventQueue(RT_INDEFINITE_WAIT);
    761 //     }
     779#endif
    762780
    763781    com::Shutdown();
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