Skip to content

Ghiaser/OOP.Ex2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Part 1

part1 diagram.png

In this part we wanted to visualize the differences between 3 methods,running without threads,running with threads and running with threadpool. all the methods doing the same actions but in different ways. the first method is running the required program without any use of threads, as we can see this is obviously the longest application of the program. this is because only 1 action is performed at a time. the second method of running the program is using threads. this is faster than running without threads at all because few actions take place at a time. but still, this method is slower than threadpool. the last method of running the program is using threadpool. this is the fastest way to do so and can be clearly seen

Part 2

part 2 diagram.png In this part we upgraded our ThreadPoolExecutor to also consider the tasks priorities in the queue.

We made a new class named Task which is our Factory of tasks and using Callable interface.

Our ThreadPoolExecuter is a custom executer which also holds the current task with the highest priority.

We also passed to the priority queue a comparator via the TypeComparator class.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages