[Bug 24044] Miranda and wineserver consume too many CPU cycles

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Aug 20 05:11:19 CDT 2010


http://bugs.winehq.org/show_bug.cgi?id=24044


Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net




--- Comment #6 from Anastasius Focht <focht at gmx.net>  2010-08-20 05:11:18 ---
Hello,

looks like the Miranda Database Driver plugin is the culprit here.
For unicode builds the default db driver is "dbx_mmap".
For ansi builds the default db driver is "dbx_3x".

The mmap plugin sets up a fast running timer (and restarts it) to flush mapped
sections to disk (hence it's not recommended to run this on network shares).

The source of the plugin is available so you can take a look by yourself:

http://addons.miranda-im.org/details.php?action=viewfile&id=3601

--- snip dbcache.c ---
void DBFlush(int setting)
{
    if(!setting) {
        log0("nflush1");
        if(safetyMode && pDbCache) {
            if (FlushViewOfFile(pDbCache, 0) == 0)
                DatabaseCorruption(NULL);
        }
        log0("nflush2");
        return;
    }
    KillTimer(NULL,flushBuffersTimerId);
   
flushBuffersTimerId=SetTimer(NULL,flushBuffersTimerId,50,DoBufferFlushTimerProc);
}

...
static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd,UINT message,UINT
idEvent,DWORD dwTime)
{
    if (!pDbCache) return;

    KillTimer(NULL,flushBuffersTimerId);
    log0("tflush1");
    if (FlushViewOfFile(pDbCache, 0) == 0)
        DatabaseCorruption(NULL);
    log0("tflush2");
}
--- snip dbcache.c ---

This creates a lot of context switches, responsible for some cpu load (on older
machines).
On modern machines the load should be well below 1-2%, if any. Though it's
still a lot of context switches which drops overall performance.

Anyway, you can't directly compare Windows CPU usage with Linux. It's
calculated differently and Windows technically cheats/lies about it.
I explained it partly here (emule cpu usage):
http://bugs.winehq.org/show_bug.cgi?id=6936#c25

If you ask me -> not fixable in Wine. Switch to ANSI build which uses
dbx_3x.dll.

Regards

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list