473,320 Members | 2,189 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,320 software developers and data experts.

Doubt related to windows based timer.

Hi all,

I am having one confusion regarding windows based timer.

I read somewhere that

'Be careful with stopping, because stopped timers are disabled and are
subject to garbage collection. That means that stopped timers can not
be started again.'
I have one application containing start and stop and i am using windows
based timer.

But after clicking on stop and starting the timer again it is working
properly. And i haven't reinitialize timer object.

I am not getting whether statement which i mention above is right and
am i doing something wrong.

Please correct me if i am wrong.

Thanks in advance.

Jun 16 '06 #1
2 1150
This quote doesn't sound right to me...

Garbage collection only occurs when something goes out of sight of all
accessible objects (allowing for weak-references) - so if you can still see
it, it shouldn't be collected... and if you /can't/ see it (and it is
stopped, so not firing any events), then you can't restart it anyhows...

I'm willing to believe I could be wrong, though!

Marc
Jun 16 '06 #2
Hi,

"archana" <tr**************@yahoo.com> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hi all,

I am having one confusion regarding windows based timer.

I read somewhere that

'Be careful with stopping, because stopped timers are disabled and are
subject to garbage collection. That means that stopped timers can not
be started again.'


Not completety right, it may say that a timer with no reference to it can be
GC if stopped.
If you keep a reference to the timer it will not be GC'ed and will behave as
another regular object.

Where did you read that ?

--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


Jun 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bilo | last post by:
I have a Windows Forms Class MainGUI I have declared MainGUI maingui; public System.ComponentModel.Container components = new Container(); in the Class I call another class MediaDriver with...
4
by: Bilo | last post by:
I have a Windows Forms Class MainGUI I have declared MainGUI maingui; public System.ComponentModel.Container components = new Container(); in the Class I call another class MediaDriver with...
5
by: Dhilip Kumar | last post by:
Hi all, I have developed a windows service using the windows service project template in VS.NET. I have used three controls in the service, a timer, performance counter and a message queue...
5
by: Tom | last post by:
Using multiple System.Timers.Timer objects in a Windows Service for performing multi-thread activities in a periodic fashion. Timers are AutoReset=false, to only have a single timer execution...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.