Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: This project builds upon the TCP file server and client project, and it contains two parts. In the first part, you will need to

Instructions:
This project builds upon the TCP file server and client project, and it contains two parts.
In the first part, you will need to use the Java Executor framework to implement multi-
threading. Specifically,
On the client side, the download and the upload commands need to be
executed in separate threads (so if a large file is being downloaded or uploaded,
the client can serve other requests in parallel.)
On the server side, the download and the upload commands need to be
executed in separate threads as well.
On the server side, provide a way for the server administrator to gracefully
shutdown the server program, as follows:
o Let the administrator type a command (e.g.,Q) to close the server
program.
o Explicitly call the shutdown() method on the executor to properly shut
down the thread pool.
o Complete and exit the server program.
(Please note that, you are required to use the Java Executor framework to
implement multi-threading.)
In the second part, you will need to add proper synchronization to allow multiple
threads to upload and/or download files without causing any conflicts. This part is more
open ended and you have the freedom to select the synchronization mechanisms (such
as mutex locks, condition variables, semaphores, etc.) for your implementation.
Consider the following possible synchronization scenarios:
o We will want to allow multiple client threads to download the same file from the
server in parallel.
o If one client thread is uploading, renaming, or deleting a file on the server, no
other client threads should be able to upload/rename/delete the same file in
parallel.
o If one client is uploading, renaming or deleting a file on the server, no other
client threads should be able to download the same file in parallel.Instructions:
This project builds upon the TCP file server and client project, and it contains two parts.
In the first part, you will need to use the Java Executor framework to implement multi-
threading. Specifically,
On the client side, the download and the upload commands need to be
executed in separate threads (so if a large file is being downloaded or uploaded,
the client can serve other requests in parallel.)
On the server side, the download and the upload commands need to be
executed in separate threads as well.
On the server side, provide a way for the server administrator to gracefully
shutdown the server program, as follows:
o Let the administrator type a command (e.g.,Q) to close the server
program.
o Explicitly call the shutdown() method on the executor to properly shut
down the thread pool.
o Complete and exit the server program.
(Please note that, you are required to use the Java Executor framework to
implement multi-threading.)
In the second part, you will need to add proper synchronization to allow multiple
threads to upload and/or download files without causing any conflicts. This part is more
open ended and you have the freedom to select the synchronization mechanisms (such
as mutex locks, condition variables, semaphores, etc.) for your implementation.
Consider the following possible synchronization scenarios:
o We will want to allow multiple client threads to download the same file from the
server in parallel.
o If one client thread is uploading, renaming, or deleting a file on the server, no
other client threads should be able to upload/rename/delete the same file in
parallel.
o If one client is uploading, renaming or deleting a file on the server, no other
client threads should be able to download the same file in parallel.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

How BIM is impacting the construction industry

Answered: 1 week ago