Comparing the two solutions
Now it's time to test the serial and concurrent servers and see which has a better performance. We have automatized the tests implementing four classes that make queries to the servers. These classes are:
SerialClient
: This implements a possible client of the serial server. It makes nine requests using the query message and a query using the report message. It repeats the process 10 times, so it request 90 queries and 10 reports.MultipleSerialClients
: This class simulates the existence of several clients at the same time. For this, we create a thread perSerialClient
and execute them at the same time to see the performance of the server. We have tested from one to five concurrent clients.ConcurrentClient
: It is analogue ...
Get Mastering Concurrency Programming with Java 8 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.