01
Assignment Overview
Build a concurrent Task Scheduler and Processor that manages multiple tasks simultaneously. This project simulates a real-world scenario where multiple workers process tasks from a shared queue.
Thread Safety Required: All shared data must be properly synchronized.
Race conditions and deadlocks will result in point deductions.
Skills Applied: Thread Fundamentals (7.1), Synchronization (7.2), and Concurrency Utilities (7.3) from Module 7.
Threads
Thread creation, lifecycle, Runnable, Callable
Synchronization
synchronized, locks, wait/notify
Executors
Thread pools, ExecutorService, Future
02
Requirements
Part 1: Task Queue (40 points)
- Create a thread-safe
TaskQueueusing BlockingQueue - Implement producer threads that add tasks to the queue
- Support task priorities (HIGH, MEDIUM, LOW)
- Use PriorityBlockingQueue for priority-based processing
Part 2: Worker Pool (45 points)
- Create a configurable worker pool using ExecutorService
- Implement worker threads that process tasks from the queue
- Use Callable and Future for tasks that return results
- Implement graceful shutdown with timeout
Part 3: Synchronization Challenges (45 points)
- Implement a
SharedCounterusing AtomicInteger - Create a producer-consumer scenario with wait/notify
- Implement a read-write lock scenario for shared data
- Demonstrate deadlock prevention strategies
Part 4: Progress Monitoring (45 points)
- Track task completion status in real-time
- Use ConcurrentHashMap for task status storage
- Implement CompletableFuture for async result handling
- Create a progress reporter thread
03
Submission Guidelines
Folder Structure: Submit all files in a folder named
assignment7_yourname
Required Files:
Task.java- Task model with priorityTaskQueue.java- Thread-safe queue implementationWorkerPool.java- ExecutorService-based worker poolSharedCounter.java- Thread-safe counterProducerConsumer.java- Producer-consumer demoProgressMonitor.javaTaskScheduler.java- Main orchestratorREADME.txt
Ready to submit? Ensure no race conditions or deadlocks!
Submit Now
04
Grading Rubric
| Criteria | Points | Description |
|---|---|---|
| Task Queue | 40 | Thread-safe queue with priority support |
| Worker Pool | 45 | Proper ExecutorService usage |
| Synchronization | 45 | Correct synchronization, no race conditions |
| Progress Monitoring | 45 | Real-time tracking with concurrent data structures |
| Total | 175 |