The concurrent server part is implemented in the ConcurrentServer part. We have added two elements not included in the serial server: a cache system, implemented in the ParallelCache class, and a log system, implemented in the Logger class. First of all, it initializes the DAO part calling the getDAO() method. The main objective is that the DAO loads all the data and creates a ThreadPoolExecutor object using the newFixedThreadPool() method of the Executors class. This method receives the maximum number of worker-threads we want in our server. The executor will never have more than those worker-threads. To get the number of worker-threads, we get the number of cores of our system using the availableProcessors() method of the ...
The server part
Get Mastering Concurrency Programming with Java 9 - Second Edition 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.