473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Is Timer the best option?

48
Hi there,

I've two forms namely FormA & FormB whose constructors initialize some ActiveX controls (to display some default charts) & does some init tasks which are time consuming as shown in the below code snippet:

Expand|Select|Wrap|Line Numbers
  1.      Dim theFormA As FormA = New FormA
  2.      Dim theFormB As FormB = New FormB
  3.  
To optimize the program, I'm calling the above lines of code in two separate threads which are working absolutely fine. All I'm doing is I'm setting a flag value to True just before the execution reaches the last line of the constructor of both forms. I've a timer running all the time which checks for this flag value whether it's True or False. If the flag values are True it indicates that my threads have completed their execution. But the point to be noted here is that I'm completely relying on the Timer to determine whether or not my threads have completed their execution.

My question is - Is there a better way of determining whether or not my threads have completed their execution via any event which gets triggered just after the threads have finished their respective jobs so that I can go ahead & do other processing which currently I'm doing in the tick event of the Timer control after having determined that the threads have completed their jobs.

Thanks in advance.
Aads
Feb 21 '09 #1
0 875

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: User | last post by:
Hi, What is the best way to release all resources holded by the Timer (myTimer from class System.Timers.Timer)? Is it: 1- myTimer.dispose 2- myTimer.enabled = false 3- myTimer.close
8
by: sm | last post by:
Hi All, I need to do a task at 3pm everyday. How do I set up the timer so that the timer procedure executes at 3pm everyday? Is there any other solution other than using a timer? Thanks.
1
by: 180Reef | last post by:
I am new to using timers and am not sure which timer is best used for the timer driven vb program described below. Also, if I should use one master timer or a timer for each button (system resource...
4
by: John | last post by:
I want to write a quick app that will remind me not to slouch at the computer with an Outlook "New Mail Desktop Alert" style pop-up every 15 minutes or so. What I'd like advice on is the best...
19
by: adi | last post by:
Hi I need the following: at particular times of day, I want to make some processing. System.Windoes.Timer doesn't help much, because it exposes the Interval property. Instead, I need to tell...
10
by: DaTurk | last post by:
Hi, I'm creating an application that will need to use a timer to do a static method call every second. My question, is what would be the best timer to use? I know there are several, but I'd...
5
by: dipalichavan82 | last post by:
there r 3 types of timers if found: system.windows.forms.timer: taken from windows option on toolbox system.timers.time:taken from componet option on toolbox system.threadng.timer please help me...
8
by: Ollie Riches | last post by:
I'm looking into a production issue related to a windows service and System.Timers.Timer. The background is the windows service uses a System.Timers.Timer to periodically poll a directory location...
11
by: Anil Gupte/iCinema.com | last post by:
When I use this Dim instance As New Timer I get the error: Error 1 Overload resolution failed because no accessible 'New' accepts this number of arguments. Yet, in the help section for...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.