public static void Main(String[] arguments) { Initialize(); // Initialize Shared Queue ConcurrentQueue<Event> events = new ConcurrentQueue<Event>(); // Spawn watcher threads, try to spawn only one thread foreach (String directory in Settings.directoriesToWatch) new Thread(new ThreadStart(new Watcher(directory, events).watch)).Start(); // spawn one thread of DocumentMonitor DocumentMonitor documentMonitor = new DocumentMonitor(ref events); new Thread(new ThreadStart(documentMonitor.monitor)).Start(); // spawn one thread of StatisticsCollector StatisticsCollector statisticsCollector = new StatisticsCollector(ref events); new Thread(new ThreadStart(statisticsCollector.Collect)).Start(); }
public static void Main(String[] arguments) { Initialize(); // Initialize Shared Queue ConcurrentQueue <Event> events = new ConcurrentQueue <Event>(); // Spawn watcher threads, try to spawn only one thread foreach (String directory in Settings.directoriesToWatch) { new Thread(new ThreadStart(new Watcher(directory, events).watch)).Start(); } // spawn one thread of DocumentMonitor DocumentMonitor documentMonitor = new DocumentMonitor(ref events); new Thread(new ThreadStart(documentMonitor.monitor)).Start(); // spawn one thread of StatisticsCollector StatisticsCollector statisticsCollector = new StatisticsCollector(ref events); new Thread(new ThreadStart(statisticsCollector.Collect)).Start(); }