473,387 Members | 1,512 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,387 software developers and data experts.

What is maximum time thread can be run?

Hi all,

i want to develop one windows service wherein i want to run task
continuously after certain interval.

So what i did is i created one thread and in that thread i have written
one endless loop.

In this loop after processing is completed i call sleep method to wait
for some amount of time.

Is there any harm in this logic? Is there any maximum limit set for
thread to run. If i run this thread say for 20-30 days will it create
any problem?.

Please correct me if i am wrong.

thanks in advance.

Oct 9 '06 #1
3 3022
I would probably write a small console application to do the task then
schedule it in windows scheduler .. less voerhead when not running and no
need to re-invent the wheel.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

"archana" <tr**************@yahoo.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
Hi all,

i want to develop one windows service wherein i want to run task
continuously after certain interval.

So what i did is i created one thread and in that thread i have written
one endless loop.

In this loop after processing is completed i call sleep method to wait
for some amount of time.

Is there any harm in this logic? Is there any maximum limit set for
thread to run. If i run this thread say for 20-30 days will it create
any problem?.

Please correct me if i am wrong.

thanks in advance.

Oct 9 '06 #2
There is no such limitation, and no harm with that logic.

archana wrote:
Hi all,

i want to develop one windows service wherein i want to run task
continuously after certain interval.

So what i did is i created one thread and in that thread i have written
one endless loop.

In this loop after processing is completed i call sleep method to wait
for some amount of time.

Is there any harm in this logic? Is there any maximum limit set for
thread to run. If i run this thread say for 20-30 days will it create
any problem?.

Please correct me if i am wrong.

thanks in advance.
Oct 9 '06 #3
"archana" <tr**************@yahoo.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
[...]
Is there any harm in this logic? Is there any maximum limit set for
thread to run. If i run this thread say for 20-30 days will it create
any problem?.
There is no inherent limit to how long a thread can run, no.

Your own code may impose limits, in the form of counters or other limited
data structures, but those issues would be readily apparent to you (or they
should be, anyway :) ).
Oct 9 '06 #4

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

Similar topics

5
by: Tzach | last post by:
I'm developing a simple Java client that runs over a CORBA server. The main client thread is waiting for notification from this server. On each notification, The client creates a new thread...
0
by: David.Tymon | last post by:
>Description: MySQL v4.1.0-alpha only allows a client to prepare a maximum of 254 statements. On the 255th mysql_prepare() call, a failure is returned with no information returned by...
2
by: teddysnips | last post by:
SQL Server 2000 8.00.760 (SP3) I've been working on a test system and the following UDF worked fine. It runs in the "current" database, and references another database on the same server called...
11
by: Chris Hayes | last post by:
Greetings, I have an ASP.NET page that accepts input from an HtmlInputFile object. I have set the maximum size for HttpRequests to 2MB in the web.config file. And now I am trying to CATCH...
39
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
3
by: Madmartigan | last post by:
Hello I have the following task but am battling with the final output. How do I keep two different vectors in sync and how would I retrieve the index for the maximum value of one of the vectors??...
5
by: linda.chen | last post by:
Hi all, We have a webservice (service1), which calls another webservice(service2) from another orginization. Our end users make requests throught service1. When service2 receives a quest, it...
4
by: Manikandan | last post by:
Hi, I'm working with XML serialization. I'm writing a xml file of huge size(above 500MB) I need to show the user the progress of writing to file using progress bar. For this i need to create a...
53
by: Gianni Mariani | last post by:
Do you have a preference on maximum line width for C++ code? I've seen the craziest debates on this most silly of topic. I have witnessed engineers spent oodles of time fiddling with line...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.