Tutor profile: Virupaksha K.
Subject: Python Programming
Is using Python's multi-threading a good idea?
Even though Python offers a multi-threading package, it does not offer multi-threading in the truest form. This is because of the Global Interpreter Lock (GIL) in Python. When a new thread runs, it first needs to acquire the GIL, perform its work, then give back the GIL to the next thread. Thus the GIL forces the execution of only one thread at a time. Acquiring and releasing the GIL adds additional overhead. Thus using multi-threading does not provide the speedup other languages provide. In order to overcome this problem, users may create multi-process programs which makes use of the operating system's scheduling mechanism to run things simultaneously.
Subject: Computer Science (General)
What does "time complexity" of an algorithm mean?
Time complexity is a notion used to get a sense of how long an algorithm will take to run. It does not give the exact running time of an algorithm but instead tells how much the run time will change with a change in the number of inputs to the algorithm. Time complexity is generally specified as the best case, average case, and the worst-case time complexity. The run time complexity can be linear, denoted by O(n) (where n is the number of inputs), logarithmic, O(log(n)), quadratic, O(n^2), and others.
Subject: Computer Networking
Let us say, you are a web administrator and you have set up a website. In no time your website has started getting visitors. One day, you get an email from a visitor saying that the website loads very slowly. In order to verify it, you fire up your browser and open the website. Yes, indeed! The website is more sluggish than usual. As a web administrator, how would you go about figuring out the issue and fixing the problem?
In order to understand the problem with the website, it is important to acquaint ourselves with what happens when a visitor types in the URL of the website in his or her browser. First, the URL is sent from the browser to a DNS server to convert the URL to an IP address (known as name resolution). Next, a request for the website is created and is transmitted to the IP address of the webserver. The packet first goes to the visitor's gateway and then gets further routed based on various routing algorithms over the internet and finally lands on the webserver on a specific port (most likely 80). On getting the request, the web server reads the website files, puts them in a packet and sends them to the browser to be displayed. This packet also gets routed over the internet and back to the visitor's browser where it is rendered by the browser and finally displayed on the screen. As you can see, even the simple process of visiting a website has a large number of operations happening behind the scenes. Anyone of these operations could be slow thus leading to the website being loaded slowly. As an administrator, you will need to first check that the DNS name resolution happens quickly. This can be verified using tools like "dig". If there are no issues here, then you will need to verify that the routing is not the bottleneck. To check this run the "ping" utility and the "traceroute" utility to check if the IP is getting routed in an acceptable time. Lastly, you will want to make sure that the webserver is not overloaded with requests such that more requests to serve the website are not slow. There are various tools for checking the load on a web server. Though unlikely, it is important to check that the visitor's browser is functioning properly (not a lot of tabs open) and the visitor's computer is running fine too as these might also impact how fast the website is rendered on the visitor's computer
needs and Virupaksha will reply soon.