1. Homepage
  2. Programming
  3. Algorithm Design and Analysis - Assignment 1: Task Thread Pool

Algorithm Design and Analysis - Assignment 1: Task Thread Pool

Engage in a Conversation
Algorithm Design and AnalysisThread PoolJava

Algorithm Design and Analysis CourseNana.COM

Assignment One Due 14 October 2022 CourseNana.COM


CourseNana.COM


CourseNana.COM

The purpose of this group assignment is to develop and demonstrate classes that provide pools of threads that can be reused to perform different tasks. CourseNana.COM

The system should include the following components: CourseNana.COM

Task which is an abstract base class that implements the Runnable interface and which includes a notifyAll method that the Task can call internally while running to update any registered TaskObserver (interface) method process with progress that the run method wants to report to interested listeners. Each Task instance should receive a unique identifier when it is created from a UniqueIdentifier utility class. CourseNana.COM

Task<E,F> CourseNana.COM

+Task(param:E)
+getId():int
+
run():void +addListener(o:TaskObserver<F>):void +removeListener(o:TaskObserver<F>):void #notifyAll(progress:F) CourseNana.COM

(15 marks) CourseNana.COM

ThreadPool which holds a configurable number of (worker) threads that are used to perform requested Runnable tasks, with each thread returned to the pool (rather than destroyed) once it has completed its task so it can be reused. The following UML diagram can be used as a guide: CourseNana.COM

ThreadPool CourseNana.COM

      +ThreadPool(initialSize:int) CourseNana.COM

      +getSize():int CourseNana.COM

      +getAvailable():int CourseNana.COM

      +resize(newSize:int):void CourseNana.COM

      +destroyPool():void CourseNana.COM

      +perform(task:Runnable):boolean CourseNana.COM

A thread in the pool should not consume computer time while there is not a task for it to process, and tasks that can not be performed immediately due to no available worker threads should be held in a queue so that CourseNana.COM

perform returns immediately. The destroyPool method should ensure all already enqueued tasks are completed before terminating worker threads after which no further tasks can be perfomed by the ThreadPool. (15 marks) CourseNana.COM

Application which demonstrates an application of using the ThreadPool to process Task that are determined by information received across a TCP or UDP network connection. (15 marks) CourseNana.COM

Demonstration of features of the system within two weeks of the submission date. (5 marks) CourseNana.COM

Please indicate to the grader whether each person has agreed to be graded individually for specific features, or whether the overall grade should be split equally. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Algorithm Design and Analysis代写,Thread Pool代写,Java代写,Algorithm Design and Analysis代编,Thread Pool代编,Java代编,Algorithm Design and Analysis代考,Thread Pool代考,Java代考,Algorithm Design and Analysishelp,Thread Poolhelp,Javahelp,Algorithm Design and Analysis作业代写,Thread Pool作业代写,Java作业代写,Algorithm Design and Analysis编程代写,Thread Pool编程代写,Java编程代写,Algorithm Design and Analysisprogramming help,Thread Poolprogramming help,Javaprogramming help,Algorithm Design and Analysisassignment help,Thread Poolassignment help,Javaassignment help,Algorithm Design and Analysissolution,Thread Poolsolution,Javasolution,