Click here to Skip to main content
15,887,350 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dynamic Menu Creation Pin
Thakur JAI SINGH24-Feb-15 22:22
Thakur JAI SINGH24-Feb-15 22:22 
GeneralRe: Dynamic Menu Creation Pin
_Flaviu25-Feb-15 0:10
_Flaviu25-Feb-15 0:10 
GeneralRe: Dynamic Menu Creation Pin
Thakur JAI SINGH25-Feb-15 0:30
Thakur JAI SINGH25-Feb-15 0:30 
GeneralRe: Dynamic Menu Creation Pin
_Flaviu25-Feb-15 0:45
_Flaviu25-Feb-15 0:45 
GeneralRe: Dynamic Menu Creation Pin
Thakur JAI SINGH25-Feb-15 2:09
Thakur JAI SINGH25-Feb-15 2:09 
GeneralRe: Dynamic Menu Creation Pin
Frankie-C25-Feb-15 3:06
Frankie-C25-Feb-15 3:06 
QuestionRe: Dynamic Menu Creation Pin
David Crow25-Feb-15 5:53
David Crow25-Feb-15 5:53 
QuestionSetEvent and WaitForSiongleObject Pin
Munchies_Matt23-Feb-15 6:02
Munchies_Matt23-Feb-15 6:02 
So I have a thread, thread one, that writes a byte (an ACK) to a COM port (COM over USB), then sets an event, and a thread, thread two, that's waiting on that event with WaitForSingleObject, INFINITE, which then writes 7 bytes to the port, then goes back to waiting again. Thread one, then reads data from the port, and when its got the whole chunk, writes the ACK, sets the event, and so it goes round again. ad infinitum.

Now I have a USB analyser on the wire, so I can see the timing here, between the one byte ACK going out, and the 7 bytes of data, and it is sometimes 4 seconds! WTF | :WTF: OMG | :OMG: OMG | :OMG: WTF | :WTF:

4 seconds? One thread does a SetEvent, and the other thread, doing a WaitForSingleObject takes 4 seconds to get notified?


Dont believe me?

613 . 0x06 8 2/23/2015 5:52:20.593552 PM
614 .ABCD.. 0x02 58 56 45 52 03 1a 14 2/23/2015 5:52:24.094321 PM

See, almost 4 seconds, that's the USB sniffer trace. What the hells going on?

Just seen one trace go by, and its 8 seconds! WTF | :WTF: WTF | :WTF: WTF | :WTF: WTF | :WTF: OMG | :OMG: OMG | :OMG: WTF | :WTF:


I mean, cant MSFT tighten it up a bit? This is appaling!


( By the way, the driver is mine, and the time between the IRP_MJ_WRITES of 1 byte, and 7 bytes, also reflects the large gaps seen on the USB bus. The driver traces when its hit by the app calling WriteFile() so its not a problem in the driver either, it really is the thread scheduling. )
AnswerRe: SetEvent and WaitForSiongleObject Pin
Albert Holguin23-Feb-15 9:45
professionalAlbert Holguin23-Feb-15 9:45 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt23-Feb-15 21:26
Munchies_Matt23-Feb-15 21:26 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Jochen Arndt23-Feb-15 23:10
professionalJochen Arndt23-Feb-15 23:10 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 0:02
Munchies_Matt24-Feb-15 0:02 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Albert Holguin24-Feb-15 3:54
professionalAlbert Holguin24-Feb-15 3:54 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 4:02
Munchies_Matt24-Feb-15 4:02 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Albert Holguin24-Feb-15 4:06
professionalAlbert Holguin24-Feb-15 4:06 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 4:13
Munchies_Matt24-Feb-15 4:13 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Albert Holguin24-Feb-15 4:16
professionalAlbert Holguin24-Feb-15 4:16 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 5:13
Munchies_Matt24-Feb-15 5:13 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt23-Feb-15 22:25
Munchies_Matt23-Feb-15 22:25 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Albert Holguin24-Feb-15 4:00
professionalAlbert Holguin24-Feb-15 4:00 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 4:12
Munchies_Matt24-Feb-15 4:12 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Frankie-C24-Feb-15 5:19
Frankie-C24-Feb-15 5:19 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 6:46
Munchies_Matt24-Feb-15 6:46 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Frankie-C24-Feb-15 21:46
Frankie-C24-Feb-15 21:46 
GeneralRe: SetEvent and WaitForSiongleObject Pin
Munchies_Matt24-Feb-15 22:12
Munchies_Matt24-Feb-15 22:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.