Mobile Apps - WaitForSingleObject doesnt timeout

Asked By Alan Previn
19-Nov-09 06:35 PM
Hi folks - i am doing a driver and have a couple of threads running in it -
one threas is to handle instruction dispatching to the hardware and a second
to handle interrupt capturing. One can guess the former does depend on the
latter via event handles (to signal an interrupt from the device that the
first thread checks HW to see if it can start dispatching the next one). So
the problem i have here is that in the cases where we have too many
interrupts coming around... it happens occasionally that the 1st thread's
WaitForSingleObject just dies. Never returns. I call this function with a
timeout of 3 miliseconds (its a very fast CPU, so 3 miliseconds is very
long). And when this function hangs, its stuck forever,... the rest of the
system is actually running - i can break into other threads and set
breakpoints and see them move. But within this WaitForSingleObject - i am not
sure what happened - it reaches until some lower level kernel function - but
when i try to set breakpoints there it gets triggered too frequently because
many other processes also invoke object inspection functions.

Anyone has any idea how i can overcome this problem?
SleepTilTick
(1)
EMVP
(1)
Tobey
(1)
Eventedsounds
(1)
Breakpoints
(1)
Miliseconds
(1)
Interrupts
(1)
Runnable
(1)
  Paul G. Tobey [eMVP] replied to Alan Previn
20-Nov-09 10:04 AM
Are you sure that the thread is not deadlocked?  You know, waiting on an event
that can never be set because some other thread is waiting for the locked
thread to do something before it will set the event?  That's what it sounds
like.  If you set a time-out in the Wait, does the call always return?  You
can write your code to just try again if there is a time-out (WAIT_TIMEOUT).
If so, that seems to confirm that you are deadlocked in some way or
another...

Paul T.
  Alan Previn replied to Paul G. Tobey [eMVP]
25-Nov-09 03:00 PM
Hi Paul - sorry for the late reply. (actually i replied this already but i
forgot my IE crashed moments after pressing the "Post" button). Basically
we have always been using the timeout of 3 miliseconds. Also, we only have 1
thread that ever waits for the event and another thread that only sets it -
so 2 threads can never ever wait on that same handle.

any ideas?
  AndrewScholan[MCTS] replied to Alan Previn
26-Nov-09 05:02 AM
i
1
-
an event
ed
sounds
? =A0You
UT). =A0
n it -
second
n the
the
e). So
ad's
th a
ry
f the
i am not
n - but
because
t -

Are you sure that there is not another higher priority thread in the
system that is hogging (i.e. it never gives up the run slot)? This can
easily happen if you have something that is doing polling without
calling Sleep() or SleepTilTick(). If this is the case then the Wait
will be timing out, become runnable but never getting to the run
state.
If you are in debug build you can see what the run state of the thread
is by looking in the thread window.
Andrew.
Create New Account
help
Best regards! WindowsCE Platform Builder Discussions Windows Embedded (1) Overlay2FrameInSram (1) BaseFrameInSram (1) WindowsEmbeddedCookbook (1) EMVP (1) EmbeddedCookbook (1) DisplayType (1) DisplayDll (1) This may depend on your display timings. Usually original PXA27x display controller driver required source modification to support a different display. - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking the reply address of this message is invalid) On 15 mar, 18:28, "Valter Minute [eMVP]" it beddedCookbook om / Forums / it-IT / windowsembeddedit / threads Thanks Valter for your quick response. I may move those parameter to the registry, indead of using only the "DisplayType". - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking the reply address of this message is invalid) On 16 mar, 11:27, "Valter Minute [eMVP]" it beddedCookbook om / Forums / it-IT / windowsembeddedit / threads But, why do I need a different the timings in the right way to see the image on the screen. - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking the reply address of this message is invalid) On 16 mar, 12:27, "Valter Minute [eMVP]" . it beddedCookbook om / Forums / it-IT / windowsembeddedit / threads Ok, and do you mean that the the LCCR register and other LCD controller registers are initialized inside your code. - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking
Development Discussions Windows Embedded (1) OpenNETCF (1) ASP.NET (1) Bruce.Eitman (1) WindowsEmbeddedCookbook (1) EMVP (1) BeddedCookbook (1) Eurotech (1) Do you have the BSP? Without it, this is going done if they want to. Certainly offering to pay them might motivate them. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech done if they want to. Certainly offering to pay them might motivate them. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech work on your specific device without needing much work (maybe configuring the display). - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking work on your specific device without needing much work (maybe configuring the display). - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking s System applet to check on the CPU architecture, what does it say? - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech I meant an embedded x86-based PC, using a standard processor and chipset. - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking I meant an embedded x86-based PC, using a standard processor and chipset. - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking
in advance for your help. WindowsCE Platform Builder Discussions Visual Studio (1) Bruce.Eitman (1) EMVP (1) BruceEitman (1) Eurotech (1) Tobey (1) Init (1) Devicethen (1) Do you have any debug output? I do not see 2008 / 12 / 12 / windows-ce-automatically-start-application-with-command-line-parameters.aspx - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech future. Do you have any debug output? Really, an answer would be valuable. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech are you using Platform Builder? Are you building the OS for your device? - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech put it back in, it does not mean let the backlight go off. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech your help. - - Message posted via http: / / www.pocketpcjunkies.com How did you reboot? - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech ie is causing a problem. Creating a wrapper would be the next step. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech
memory card. Your help is greatly appreciated. Bill WindowsCE App Development Discussions Bruce.Eitman (1) EMVP (1) ThunderHawk (1) OSs (1) Eurotech (1) Skyfire (1) Windows (1) Fennec (1) I think Typically a BSP is developed and used by the OEM of the device. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech Typically a BSP is developed and used by the OEM of the device. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech Is it for your CPU? Is it for your version of Windows CE? - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech Is it for your CPU? Is it for your version of Windows CE? - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech com My response was not intended to be cute. It was dead serious. - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech processor 3. You may not have downloaded a Windows Mobile version of Opera - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech processor 3. You may not have downloaded a Windows Mobile version of Opera - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech
Builder Discussions Windows Embedded (1) Visual Studio (1) Bruce.Eitman (1) WindowsEmbeddedCookbook (1) OSDesign (1) EMVP (1) SDKs (1) QFEs (1) What do you mean with "I can no longer develop to select it? Old solutions can still be built using the old SDK? - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking the reply address of this message is invalid) On 9 mar, 17:32, "Valter Minute [eMVP]" Old solutions can no longer be developped. And the SDK disappears from the list of uninstall and reinstall them. When you install / unistall SDKs, keep Visual Studio closed. - - Valter Minute (eMVP) Training, support and development for Windows CE: www.fortechembeddedlabs.it My embedded programming and cooking OSDesign from scratch or did you copy any files from the previous OSDesign? - - Bruce Eitman (eMVP) Senior Engineer Bruce.Eitman AT Eurotech DOT com My BLOG http: / / geekswithblogs.net / bruceeitman Eurotech that there is still a problem. Paul T. On 9 mar, 20:36, "Bruce Eitman [eMVP]" the No. Unfortunately I cannot create the OSDesign from scratch. I copied the previous OSDesign different. Do you think this will change something? On 9 mar, 21:14, Paul G. Tobey [eMVP] <paultobey _at_ earthlink _dot_ VS t er d tall The name I get in the