Re: Thread related design advice please
- From: "Bishman" <jonathan.bishop@xxxxxxxxxxxxxx>
- Date: Tue, 12 Sep 2006 16:26:37 +0100
Could I use two forms timers, one to handle the DB query and one to handle
the UI update ?
If I take this approach I would assume I would still need to perform some
thread safety around the saving and retrieving of records ?
ie Thread 1 updates retrieves DB records and saves them away in the 'queue',
thread two reads from the 'queue' at set intervals and updates the ui ?
.........confused......
Jon
"Bishman" <jonathan.bishop@xxxxxxxxxxxxxx> wrote in message
news:eAHUBxn1GHA.1588@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a form application that needs to query a DB at a set timed interval
and then refresh the form with values received from the DB. Simple enough.
My design releated questions are ....
Should I create a worker thread that encapsulates a timer, (which I
believe will also create a seperate thread when the timer fires) , or
should I create a timer that creates a new thread when it fires ? Or
neither ?
Which sort of timer should I use. "System.Timers.Timer" or
"System.Windows.Forms.Timer"
I was going to 'place' the results of the DB query into a queue of some
sort that can then be retrieved at a set interval ( another timer ? ) and
display them on the form. How do I make this queue threadsafe ?
Some general design pointers would be appreciated.
Thanks.
Jon.
.
- References:
- Thread related design advice please
- From: Bishman
- Thread related design advice please
- Prev by Date: Re: how would *you* do this?
- Next by Date: Re: a problem in using flatlayoutpanel
- Previous by thread: Re: Thread related design advice please
- Next by thread: Re: Thread related design advice please
- Index(es):
Relevant Pages
|