How to write a thread application
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sujit_Sheth
Posted On:   Wednesday, June 12, 2002 03:04 AM

I want to write an application which will get called after every 3 hour. This will call a procedure from database gets records and processes further.How to write this? Is there a way without using threads?

Re: How to write a thread application

Posted By:   Simon_Ablett  
Posted On:   Wednesday, June 12, 2002 03:24 AM

Simplest way is to have the application running constantly. Sleep for a period of time (3 hours!!). Wakeup. Perform its action and sleep again. No need for threads.

Alternatively, sleep for a period. Wakeup. Check the system clock against a last recorded value. If the difference is 3 hours then perform the action. Otherwise sleep again and so on.

Regards,

Simon
About | Sitemap | Contact