Design question

wim sturkenboom

Well-known member
Joined
Aug 6, 2014
Messages
85
Location
Roodepoort, South Africa
Programming Experience
10+
I'm designing / writing a windows service

  1. to check at a certain time of the day if certain files exist in a certain directories. At 10:00 it will e.g. check directory dir001 for the existence of file001 and directory dir002 for the existence of file002, at 16:00 it will check directory003 for file003 and directory004 for file004 etc
  2. monitor several directories for new files to arrive

For (1), I'm using a System.Threading.Timer for each time of the day that directories need to be checked (so one timer for 10:00 and one timer for 16:00 in the example). The reason for System.Threading.Timer is that I need to pass parameters to the callback.
Q1: I'm a bit worried that, if the user configures e.g. 48 different times in the day, I will run out of (timer) resources.

For (2), I'm using FileSystemWatcher (one per directory that needs to be monitored).
Q2: Again, I'm worried that, if the user wants to monitor 300 different directories, I will run out of (FileSystemWatcher) resources.

Are my worries real or do I just imagine them? Is there a better approach to either (1) or (2).

Thanks in advance for the advice.

PS
The directories in question can be on the local machine as well as on a local network.
 
Top Bottom