You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
## Assignment 01 - Pi
1
+
## Assignment 01 - Pi (π)
2
2
3
3
Write a program that activates a thread T that performs the approximate calculation of π.
4
4
@@ -52,12 +52,12 @@ The Polo Marzotto's computer lab is used by three types of users, students, thes
52
52
53
53
The professors have priority over everyone in the access to the laboratory, the thesis students have priority over the students.
54
54
55
-
Nobody can be interrupted while using a computer. Write a JAVA program that simulates user and tutor behavior. The program receives as input the number of students, thesis students and professors who use the laboratory and activates a thread for each user. Each user accesses k times to the lab, with k generated randomly. Simulate the time interval between one access and the next one and the time spent in the laboratory using the sleep method. The tutor has to coordinate access to the lab. The program must end when all users have completed their access to the laboratory.
55
+
Nobody can be interrupted while using a computer. Write a JAVA program that simulates user and tutor behavior. The program receives as input the number of students, thesis students and professors who use the laboratory and activates a thread for each user. Each user accesses k times to the lab, with k generated randomly. Simulate the time interval between one access and the next one and the time spent in the laboratory using the sleep method. The tutor has to coordinate access to the lab. The program must end when all users have completed their access to the laboratory.
56
56
<br>
57
57
58
58
## Assignment 04 - Computer lab with Monitor
59
59
60
-
Solve the problem of the computer lab simulation, of the previous assignment, using the Monitor construct.
60
+
Solve the problem of the computer lab simulation, of the previous assignment, using the Monitor construct.
61
61
<br>
62
62
63
63
## Assignment 05 - File Crawler
@@ -79,6 +79,7 @@ The program must be structured as follows:
79
79
* consumers take directory names from the queue and print their content (file names)
80
80
81
81
* the queue must be created with a LinkedList. Remember that a Linked List is not a thread-safe structure. From the JAVA API: *“Note that the implementation is not synchronized. If multiple threads access a linked list concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally”*
82
+
<br>
82
83
83
84
## Assignment 06 - Bank accounts
84
85
@@ -117,12 +118,14 @@ Further indications
117
118
118
119
Write an echo server program using the java NIO library and, in particular, the Selector and channels in non-blocking mode, and an echo client program, using NIO (also fine with blocking mode).
119
120
120
-
* The server accepts requests for connections from clients, receives messages sent by clients and sends them back (possibly adding "echoed by server" to the received message).
121
+
* The server accepts requests for connections from clients, receives messages sent by clients and sends them back (possibly adding "echoed by server" to the received message)
121
122
122
123
* The client reads the message to be sent from the console, sends it to the server and displays what it has received from the server.
123
124
124
125
<br>
126
+
125
127

128
+
126
129
<br>
127
130
128
131
## Assignment 09 - UDP Ping
@@ -137,14 +140,14 @@ Also, since the execution of the programs will run on a single host or on the lo
137
140
138
141
### PING Client
139
142
140
-
* accepts two command-line arguments: **server name and port**. If one or more arguments are incorrect, the client terminates after printing an error message like *ERR -arg x*, where x is the argument number.
143
+
* accepts two command-line arguments: **server name and port**. If one or more arguments are incorrect, the client terminates after printing an error message like *ERR -arg x*, where x is the argument number
141
144
142
145
* uses UDP communication to communicate with the server and sends 10 messages to the server, with the following format:
143
146
144
147
PING seqno timestamp
145
148
where *seqno* is the PING sequence number (between 0-9) and the *timestamp* (in milliseconds) indicates when the message was sent
146
149
147
-
* does not send a new PING until it has received the echo of the previous PING, or a timeout has expired.
150
+
* does not send a new PING until it has received the echo of the previous PING, or a timeout has expired
148
151
149
152
* Print each message sent to the server and the ping RTT or a * if the response was not received within 2 seconds
150
153
@@ -173,26 +176,24 @@ Also, since the execution of the programs will run on a single host or on the lo
173
176
174
177
Define a *TimeServer* server, which:
175
178
176
-
* sends the date and time to a multicast group *dategroups* at regular intervals.
177
-
* waits between one sending and the next a time interval simulated by the sleep () method.
179
+
* sends the date and time to a multicast group *dategroups* at regular intervals
180
+
* waits between one sending and the next a time interval simulated by the sleep () method
178
181
179
182
The IP address of *dategroup* is introduced by the command-line.
180
183
181
-
Then define a *TimeClient* client that joins *dategroup* and receives, ten consecutive times, date and time, displays them, then terminates.
184
+
Then define a *TimeClient* client that joins *dategroup* and receives, ten consecutive times, date and time, displays them, then terminates.
182
185
<br>
183
186
184
187
## Assignment 11 - Congress management
185
188
186
-
Design a Client/Server application for managing registrations at a congress. The organization of the congress provides the speakers of the various sessions with an interface through which to subscribe to a session, and the possibility of viewing the programs of the various days of the congress, with the interventions of the various sessions. The server maintains the programs of the 3 days of the congress, each of which is stored in a data structure, in which each line corresponds to a session (in total 12 for each day).
187
-
188
-
For each session, the names of the registered speakers (maximum 5) are stored.
189
+
Design a Client/Server application for managing registrations at a congress. The organization of the congress provides the speakers of the various sessions with an interface through which to subscribe to a session, and the possibility of viewing the programs of the various days of the congress, with the interventions of the various sessions. The server maintains the programs of the 3 days of the congress, each of which is stored in a data structure, in which each line corresponds to a session (in total 12 for each day). For each session, the names of the registered speakers (maximum 5) are stored.
189
190
190
191
The client can request operations to:
191
192
192
-
* register a speaker at a session;
193
-
* get the program of the congress;
193
+
* register a speaker at a session
194
+
* get the program of the congress
194
195
195
-
The client forwards requests to the server via the **RMI** mechanism. Provide, for each possible operation, the management of any abnormal conditions (for example the request for registration to a non-existent day and/or session or for which all the intervention spaces have already been covered)
196
+
The client forwards requests to the server via the **RMI** mechanism. Provide, for each possible operation, the management of any abnormal conditions (for example the request for registration to a non-existent day and/or session or for which all the intervention spaces have already been covered).
196
197
197
198
The client is implemented as a cyclic process that continues making synchronous requests until all user needs are exhausted. Establish an appropriate termination condition for the request process.
0 commit comments