bibikurosawa / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

Ruby Binding : busy loop at DR_Dispatch() #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run any ruby binding sample 
2.
3.

What is the expected output? What do you see instead?

expect event driven, but polling  by busy loop.
so, CPU power is uselessly consumed. 

What version of the product are you using? On what operating system?

dokan-ruby-0.1.4.938 2007/12/13

Please provide any additional information below.

need to add ResetEvent() 
and have to move SetEvent() in DR_DispatchAndWait() into Mutex control.

@@ -833,9 +833,9 @@

    WaitForSingleObject(g_DispatchMutex, INFINITE);
    InsertTailList(&g_EventQueue, &entry->ListEntry);   
+   SetEvent(g_DispatchEvent);
    ReleaseMutex(g_DispatchMutex);

-   SetEvent(g_DispatchEvent);

    WaitForSingleObject(entry->Event, INFINITE);

@@ -1788,6 +1788,7 @@
    while(TRUE) {
        WaitForSingleObject(g_DispatchEvent, INFINITE);
        WaitForSingleObject(g_DispatchMutex, INFINITE);
+       ResetEvent(g_DispatchEvent);        

        while(!IsListEmpty(&g_EventQueue)) {
            PLIST_ENTRY listEntry = RemoveHeadList(&g_EventQueue);

Original issue reported on code.google.com by mta...@gmail.com on 11 Oct 2008 at 1:04

GoogleCodeExporter commented 9 years ago
Please fix this issue, since I cannot get the code to compile I cannot do it 
myself.

Original comment by baswilb...@gmail.com on 17 Nov 2008 at 8:26

GoogleCodeExporter commented 9 years ago
Fixed on Dokan Ruby 0.1.5.

Original comment by asa...@gmail.com on 10 Dec 2008 at 6:48