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
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -25,20 +25,20 @@
25
25
* TA : Scott Kristjanson
26
26
27
27
## Description
28
-
This program aims to decrypt large numbers of encrypted tweets, to speed up and take advantages of multiple CPU cores, we use fork function to spread the decryption task across multiple processes and use pipes to pass messages between the parent processor and child processors with two different scheduling algorithm "round robin" and "first come first serve".
28
+
This program aims to decrypt large numbers of encrypted tweets, to speed up and take advantages of multiple CPU cores, we use fork function to spread the decryption task across multiple processes and use pipes to pass messages between the parent process and child processes with two different scheduling algorithm "round robin" and "first come first serve".
29
29
Same as before, each tweet’s decryption follow four steps below:
30
30
1. Remove unnecessary characters in regular interval.
31
31
2. Transform each group of 6 characters into an integer using base 41.
32
32
3. Map each cipher number onto a similar plain-text number.
33
33
4. Get the final decrypted text by use the inverse function of Step 2.
34
-
More Details can be found in [Assignment 2 - Process Management](https://courses.cs.sfu.ca/2015fa-cmpt-300-d1/pages/AssignmentThree/view)
34
+
More Details can be found in [Assignment 3 - Message Passing & Scheduling](https://courses.cs.sfu.ca/2015fa-cmpt-300-d1/pages/AssignmentThree/view)
35
35
36
36
## Project Structure
37
37
* "lyrebird.c" : contains the main loop function which using fork function to create child processes to do the decryption for each tweet file.
38
38
* "decrypt.c" : contains a decrypt function, which go through 4 steps and in each step it call some functions in dec_func.c to handle decryption.
39
39
* "dec_func.c" : contains many functions that used to decrypt the tweet, like remove extra characters, mapping characters to integer value and mapping integer to characters.
40
40
* "pipe.c" : contains many functions that related to pipe including initialize pipe, close pipe and select pipe.
41
-
* "scheduling.c" : contains two functions, each contains a scheduing algorithm that used to assign tasks to child processors in parent processor.
41
+
* "scheduling.c" : contains two functions, each contains a scheduling algorithm that used to assign tasks to child processes in parent process.
42
42
* "line_io.c" : contains two functions, input one line data from file and output one line data to file
43
43
* "memwatch.c" : mainly used for detecting un-freed memory, overflow and underflow to memory buffers.
44
44
@@ -54,12 +54,12 @@ More Details can be found in [Assignment 2 - Process Management](https://courses
54
54
* Check whether the input and output file exist or not.
55
55
* Check whether the tweet is multiple of 6 after removing extra characters.
56
56
* Dynamic manage memory and guarantee to free all when program finished (also checked malloc function to see if it failed).
57
-
* Parent process wait until all his child processers finished before exit.
58
-
* Close all pipes that do not need in each processors.
57
+
* Parent process wait until all his child processes finished before exit.
58
+
* Close all pipes that do not need in each processes.
59
59
* Empty data and largest data tested (used data set from assignment #2).
60
60
61
61
## Reference list
62
62
[Select function - Linux man page](http://linux.die.net/man/2/select)
63
63
[Multiple pipes and forks example](http://www.sfu.ca/~reilande/)
64
64
[C using select() to read from two named pipes (FIFO) - Stackoverflow](http://stackoverflow.com/questions/28519119/c-using-select-to-read-from-two-named-pipes-fifo)
65
-
[Set up arguments each time when using select function - Stackouverflow](http://stackoverflow.com/questions/3324078/why-select-always-return-0-after-the-first-timeout)
65
+
[Set up arguments each time when using select function - Stackoverflow](http://stackoverflow.com/questions/3324078/why-select-always-return-0-after-the-first-timeout)
0 commit comments