Create a thread pool-based system for processing multiple files concurrently with configurable processing rules.
- Must implement a generic thread pool
- Must support dynamic number of worker threads
- Must handle task distribution efficiently
- Must implement proper shutdown mechanism
- Must support processing files from multiple directories
- Must implement these analyzers:
- Word count
- Line count
- Character frequency
- File size statistics
- Must use Arc and Mutex for shared state
- Must implement proper error handling
- Must support cancellation
- Must handle all file system errors gracefully
- Real-time progress updates
- Per-file processing status
- Error reporting with context
- Processing time statistics
struct FileAnalysis {
filename: String,
stats: FileStats,
errors: Vec<ProcessingError>,
processing_time: Duration,
}
struct FileStats {
word_count: usize,
line_count: usize,
char_frequencies: HashMap<char, usize>,
size_bytes: u64,
}- Support for different file encodings
- Extensible analyzer system
- Memory usage limiting
- Progress persistence
- Resume capability
- Unit tests for thread pool
- Integration tests for file processing
- Performance benchmarks
- Error handling scenarios