cs211 lab3
https://maths.nuigalway.ie/~gettrick/teach/cs211/
-
The source code must
be well presented (indenting, spaces, reasonable variable/function names,
etc.) and must include comments (as a rough guideline - aim to have nearly as
many comments as lines of code). Any questions asked should be answered by
typing the answers into the comments within the PYTHON code
(after the comment sign #)
-
You should test your program on different inputs (if applicable)
before presenting it for marking.
-
This will be graded only in person in the lab.
-
Plagiarism (the unattributed copying of work from other sources
(internet, fellow students,....)) will not be tolerated.
You risk getting zero for your lab if it is found to be
plagiarized.
Study the program "thread10.py" (and perhaps the other PYTHON programs
beginning with thread****.py and/or *url*.py)
in the CANVAS web pages (under the "Files" menu)
-
TASK
Modify the program as follows: 1) It should read in the URLS from the user
(any number of them).
2) It also reads in from the user a positive integer (lets call it n)
which is the maximum
number of simultaneous web addresses that will be queried. Use a semaphore
to limit (to n) the number of (parallel) threads querying external web pages, and a
MUTEX to limit the printouts to one thread at a time.
©
University of Galway