Posts

Showing posts with the label Multiprocessing

Introduction to network programming with Python #0003 HTTP 2020 Tutorial)

Image
  Table of Contents 1. Introduction to HTTP 2. Write a TCP server that serves as a HTTP server 3. A HTTP server demo 4. A HTTP server with multiprocessing 5. A HTTP server with multithreading 6. A HTTP server with gevent 7. A multitasking TCP server without threadings, multiprocessing, and gevent 8. HTTP Persistent connection Vs multiple connections 9. Improve our server with epoll (Linux only)

Introduction to multitasking with Python #002 multiprocessing (2020 tutorial)

Image
  1. What are processes? When you write a program and save it on your computer, it is just a file that cannot use resources, such as network, camera, keyboads etc. But when you lauch the program and have it running, a process is created and it can use computer resources such as memory, carmera, keyboard etc.  When you start your operating system, there are a lot of processes will be created by the OS automatically. On windows you can open the task manager to see all the processes running. On windows, under the tab of Processes, you could see all the processes and also you could kill the running process if you have the permission to do so. On Ubuntu you could use command: ps -aux to list all the processes. 2. Introduction to multiprocessing module In the last topic, we have touched the topic on multithreading. Multithreading is a way to achieve multitasking for a program and multiprocessing is another way to achieve that end. Its usage is very similar to that of threading module. Let