Monday, October 29, 2007

Implementation of the background service

A new class, DailyRDAHMMRunner, is added to Exec_RDAHMMService project, to run RDAHMM daily on all stations in background. This class contains a main() entry so that it can run as a stand alone process. This class creates a list of all stations with a state assigned to every station to denote if RDAHMM has been run “today” on this station. Initially every station’s state is assigned as waiting to be run. Then a specific number of threads (this number can be specified when the program is started) are created to run RDAHMM on a series of stations. Every station keeps trying to get the next waiting-to-be-run station from the list, runs RAHMM on it, and generates necessary results for the station. Once there are no waiting-to-be-run stations left in the list, the thread sleeps until the scheduled running time on “tomorrow”.

No comments: