Computer Science Question
1. The runServer method below creates 1-thread per client. Hence. it very susceptible to Denial of Service (DoS) attack.To mitigate this issue, modify the runServer method to use no more than 25 detached threads at any given time You must implement it using a suitable sleep-wakeup approach. You may add as many variables as needed.
2. Large prime numbers play a central role in cryptography. The following isPrime method
is slow when working with large prime numbers. Multi-thread the following isPrime method using the data-parallel approach using k threads.
3. Backups are important to recover data after hardware failures, malware, or just accidental
erasure. Backups are typically created by copying files to a remote machine. Accordingly, complete the following program to use scp to copy the given list of files from the local computer to a remote machine, on the same path. You may assume the user IDs are the same on the local and remote host
4. The following method reverses a list. removes all even numbers, and then returns at most 100 values. For example, given the string “1 2 3 4 5”. it returns “5 3 1”. Rewrite the method just using regular loops. operators, and if-statements only — no.you cannot use any methods.
Recode the above implementation using the following starter-code:
