What is maximum time thread can be run?

  • Thread starter Thread starter archana
  • Start date Start date
A

archana

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.
 
archana said:
[...]
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 :) ).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top