预定/报价
cs22 computer language
珠玉2024-04-11 16:00:15
Objective:
This assignment will introduce you to interprocess communication mechanisms in UNIX using sockets.
Problem:
You must write two programs to implement a distributed version of the multithreaded incremental entropy algorithm you created
for programming assignment 1. 
These programs are:
The server program:
The user will execute this program using the following syntax: ./exec_filename port_no where exec_filename is the name of your executable file and port_no is the port number to create the socket. The port number will be available to the server program as a command line argument.
The server program does not receive any information from STDIN and does not print any messages to STDOUT.

The server program executes the following task: 

◦ Receive multiple requests from the client program using sockets. Therefore, the server program creates a child process per request to handle these requests simultaneously. For this reason, the parent process must handle zombie processes by implementing the  fireman() function call (unless you can determine the number of requests the server program receives from

the client program).
Each child process executes the following tasks:
1. First, receive the input with the scheduling information of a CPU from the client program.
2. Next, use the incremental entropy algorithm proposed by Dr. Rincon to calculate the entropy of the CPU at each scheduling instant.
3. Finally, return the calculated entropies to the client program using sockets.
The client program:

The user will execute this program using the following syntax:

./exec_filename hostname port_no < input_filename where exec_filename is the name of your executable file, hostname is the address where the server program is located, port_no is the port number used by the server program, and input_filename is the name of the input file. The hostname and the port number will be available to the client as command-line arguments.

The client program receives from STDIN (using input redirection) n lines (where n is the number of input strings).

Each line from the input represents the scheduling information of a CPU in a multiprocessor platform.

my wechat:_0206girl
Don't hesitate to contact me