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
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@
4
4
5
5
## Description
6
6
7
-
This program aims to **decrypt large numbers of encrypted tweets**. To **take advantages of multiple machines**, it uses a distributed system with *client-server* architecture. Server will assign tasks to the clients and store messages to the log file; client will decrypt each task assigned and send result message back. To **take advantages of multiple CPU cores**, each client uses fork function to spread the decryption tasks across multiple processes and uses pipes to communicate between the parent and child processes using "first come first serve" scheduling algorithm.
7
+
This program aims to **decrypt large numbers of encrypted tweets**. The program uses a distributed system with *client-server* architecture to **take advantages of multiple machines**. The server assigns tasks to the clients and stores messages in the log file. The client decrypts each task assigned and sends the result message back to the server. The program **takes advantages of multiple CPU cores** by allowing each client to use the fork function to allocate the decryption tasks across multiple processes and pipes to communicate between the parent and child processes with "first come first serve" scheduling algorithm.
8
8
9
-
Same as before, each tweet’s decryption follows four steps:
9
+
Each tweet’s decryption follows four steps:
10
10
11
11
1. Remove unnecessary characters in a regular interval.
12
12
@@ -20,26 +20,26 @@ Same as before, each tweet’s decryption follows four steps:
20
20
21
21
## Project Structure
22
22
23
-
***"lyrebird.server.c"** : contains the main loop function for the server side which :
24
-
1.regularly accept new clients and assign tasks to them;
25
-
2.keep receiving messages from clients and write them to the log file;
26
-
3. wait for all clients finish their tasks;
23
+
***"lyrebird.server.c"** : contains the main loop function for the server side:
24
+
1. accept new clients regularly and assign tasks to them;
25
+
2.continuously receive messages from clients and write them to the log file;
26
+
3. wait for all clients to finish their tasks;
27
27
4. exit.
28
-
***"lyrebird.client.c"** : contains the main loop function for the client side which :
28
+
***"lyrebird.client.c"** : contains the main loop function for the client side:
29
29
1. use fork function to create child processes to decrypt each tweet file;
30
-
2.keep communicating with the server side.
31
-
***"svr_func.c"** : contains many functions that used in the server side
32
-
***"cli_func.c"** : contains many functions that used in the client side
33
-
***"scheduling.c"** : contains one function, which is 'fcfs' scheduling algorithm that is used to assign tasks to the child processes in the parent process.
34
-
***"decrypt.c"** : contains a decryption function, which goes through 4 steps. In each step it calls some functions in dec_func.c to handle decryption.
35
-
***"dec_func.c"** : contains many functions that are used to decrypt the tweets, like removing extra characters, transforming between characters and integers.
36
-
***"line_io.c"** : contains two functions, which input one line data from file and output one line data to file
37
-
***"memwatch.c"** : mainly used for un-freed memory detection, overflow and underflow to memory buffers.
30
+
2.continuously communicates with the server side.
31
+
***"svr_func.c"** : contains server side functions
32
+
***"cli_func.c"** : contains client side functions
33
+
***"scheduling.c"** : contains a single 'fcfs' scheduling algorithm for assigning tasks to the child processes in the parent process.
34
+
***"decrypt.c"** : contains a decryption function of 4 steps. In each step, the decryption function calls functions in dec_func.c to handle decryption.
35
+
***"dec_func.c"** : contains functions for decrypting the tweets, such as removing extra characters,and transforming between characters and integers.
36
+
***"line_io.c"** : contains two functions for input/output one line of data from/to files
37
+
***"memwatch.c"** : mainly for un-freed memory detection, overflow and underflow to memory buffers.
38
38
39
39
## How to Use
40
40
41
41
1. Unzip all the files into one folder and cd into it.
42
-
2. Run command `make`, having all the source file compiled and linked.
42
+
2. Run command `make` to link and compile the source files.
43
43
3. Run command `./lyrebird.server <config_file> <log_file>` to set up a server.
0 commit comments