all groups > dotnet compact framework > october 2004 >
You're in the

dotnet compact framework

group:

Multi Threading


Re: Multi Threading Alex Feinman [MVP]
10/31/2004 1:11:45 PM
dotnet compact framework: Don't see anything obviously wrong, but perhaps a better approach would be
to do animation on a timer event (Forms.Timer as opposite to
System.Threading.Timer). This is by the way what OpenNETCF Animation control
is doing (hint, hint)

I assume whatever you do right now to animate your graphics is done with
Control.Invoke in mind

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]

Re: Multi Threading Alex Feinman [MVP]
10/31/2004 3:07:31 PM
I see what you mean. Of course using forms timer will not work if your form
is busy initializing. And even Invoke from a thread will not either, since
Invoke simply posts a message to the UI thread.

I think that the problem witn menus might have something to do with the lack
of UI idle time. One thing that comes to mind is to drop the animation
thread priority at the end of the main form's load event (after the
initialization is done)

--
Alex Feinman
---
Visit http://www.opennetcf.org
[quoted text, click to view]

Multi Threading Glyn Meek
10/31/2004 4:32:38 PM
1) I have an 'animated' graphic window that displays as the application is
loading and doing its initialization. This animation routine is staretd as
a separate thread at the beginning of the Mainform load.
2) The animation form is smaller than the screen and so overlays the main
application window.
3) Rather than have the animation thread terminate when the main application
has finished loading/initializing, I want to have it terminate when a user
selects a menu item from the main application and goe off to do the
appropriate application programming.
4) Everything appears to work well, in that the animation 'animates' (!),
the main application loads and initializes, and the main application form
displays under the animation window and all the menu items appear...
....but
5) None of the main application form menu items appear to be 'live'.

My intention is that the first action taken when one selectes a main
application menu item is to 'kill' the animation thread, but I cannot get to
that point if I cannot recognize a menu click event on the main application
form..

Now, I realize that multithreading has a number of 'gotchas', but I cannot
figure out what I am a) not doing or b) am trying to do but am not allowed
to do.

Anyone help?

Regards

Glyn Meek

Re: Multi Threading Glyn Meek
10/31/2004 10:45:38 PM
Alex...I had considered this, but worried that merely using a timer event
(rather than a separate thread) would NOT allow me to refresh images on my
main form as no event would occur to redraw the form! Is this NOT the case?

I found the mechanism I am using at

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/casoast.asp


Regards

Glyn


[quoted text, click to view]

Re: Multi Threading Glyn Meek
11/1/2004 11:59:53 PM
Alex...thanks. After reading your recommendations, I 'simplified' and
reduced my expectations! Rather than having it animate in real time while
the initializations were taking place, I started a timer loop after the
short initializations and as I really needed it to sit there until a user
makes their first selection, it works perfectly now and was MUCH simpler
than using multithreading.

Glyn

[quoted text, click to view]

AddThis Social Bookmark Button