The Python threading module uses threads instead of processes. Threads run in the same unique memory heap. Whereas Processes run in separate memory heaps. This, makes sharing information harder with processes and object instances. One problem arises because threads use the same memory heap, multiple threads can write to the same location in the memory heap which is why the global interpreter lock(GIL) in CPython was created as a mutex to prevent it from happening.
The multithreading library is lightweight, shares memory, responsible for responsive UI and is used well for I/O bound applications. Check this simple example of...multithreaded socket programming
The multithreading library is lightweight, shares memory, responsible for responsive UI and is used well for I/O bound applications. Check this simple example of...multithreaded socket programming